May 25, 2017

How to set up a LAMP Server and OXID eShop on CentOS

CentOS Logo

With this tutorial we provide you a step-by-step instructions for installing a full-featured LAMP stack and OXID eShop on a CentOS system. In the following you will be instructed on setting up Apache, MySQL, PHP and OXID eShop.

Root access is required to edit the following files and to execute commands. Log in as root (su) or simply prepend sudo to all commands that require root privileges.

Configure the Linux server

We are using CentOS 6 with 64 bit.

rpm -Uvh ftp://mirror.switch.ch/pool/1/mirror/epel/6/x86_64/epel-release-6-5.noarch.rpm
yum groupinstall “Base”
yum groupinstall “Development Tools”
yum update

Install and Configure the Apache Web Server

yum install httpd

Make a backup of the httpd.conf file.

cp /etc/httpd/conf/httpd.conf ~/httpd.conf.backup

Move to this directory and create a vhost.conf file.

cd /etc/httpd/conf.d/
vi vhost.conf

Copy the following lines in the vhost.conf, replace domain.com with your domain and save it.

NameVirtualHost *:80
<VirtualHost *:80>
     ServerAdmin webmaster@domain.com
     ServerName domain.com
     ServerAlias www.domain.com
     DocumentRoot /srv/www/domain.com/public_html/
     ErrorLog /srv/www/domain.com/logs/error.log
     CustomLog /srv/www/domain.com/logs/access.log combined
</VirtualHost>

Anytime you change an option in your vhost.conf file, remember to reload the configuration with the following command:

/etc/init.d/httpd reload

Create the website directories. Replace domain.com with your domain.

mkdir -p /srv/www/domain.com/public_html
mkdir /srv/www/domain.com/logs

Open the httpd.conf file to enable mod_rewrite.

vi /etc/httpd/conf/httpd.conf

Go to <Directory /> and <Directory "/var/www/html"> and replace AllowOverride None with AllowOverride All.

AllowOverride All

Start Apache and set the chkconfig levels to automatically start Apache when the system boots.

/etc/init.d/httpd start
/sbin/chkconfig --levels 235 httpd on

Install and Configure MySQL

yum install mysql-server
/sbin/chkconfig --levels 235 mysqld on
/etc/init.d/mysqld start

Check that MySQL is running.

netstat -tap | grep mysql

Run the MySQL secure script and set a root password.

mysql_secure_installation

Create the database. Replace USER, DATABASE and PASSWORD with your settings.

mysql -uroot -p
create user USER;
create database DATABASE character set utf8;
grant all privileges on USER.* to 'DATABASE'@'localhost' identified by 'PASSWORD';
use mysql;
update user set password=PASSWORD("PASSWORD") where User='USER';
flush privileges;
quit

Install and Configure PHP

yum install php php-pear

Open the php.ini file.

vi /etc/php.ini

Replace the following settings in your php.ini.

error_reporting = E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR
display_errors = Off
log_errors = On
error_log = /var/log/php.log
cgi.fix_pathinfo=1
expose_php = Off
upload_max_filesize = 200M
post_max_size = 200M
max_execution_time = 600
max_input_time = 600
memory_limit = 256M
mysql.allow_persistent = Off
register_argc_argv = On
date.timezone = Europe/Berlin
register_globals = Off
allow_url_fopen = On
magic_quotes_gpc = Off
magic_quotes_runtime = Off

Install some more packages.

yum install php-mysql php-bcmath php-mbstring php-soap
yum install php-gd php-pecl-apc php-ldap php-odbc php-pear php-xml php-xmlrpc
yum install curl curl-devel perl-libwww-perl ImageMagick libxml2 libxml2-devel

Install the Zend Guard Loader.

cd /tmp/
yum install php-devel
wget http://www6.atomicorp.com/channels/atomic/centos/6/x86_64/RPMS/php-zend-guard-loader-5.5.0-3.el6.art.x86_64.rpm
rpm -Uvh php-zend-guard-loader-5.5.0-3.el6.art.x86_64.rpm
rm /tmp/php-zend-guard-loader-5.5.0-3.el6.art.x86_64.rpm
/etc/init.d/httpd restart

Check that the Zend Guard Loader is loaded.

php -v

Install OXID eShop

Download OXID eShop from oxid-esales.com and upload the zip file to your website directory /srv/www/domain.com/public_html. Then you can unzip the file and set the ownership.

cd /srv/www/domain.com/public_html
unzip OXID_ESHOP_CE_4.5.8_42471.zip
chown -R apache:apache /srv/www/domain.com/public_html

Now, open the domain in your browser and start with the OXID eShop installation.

Comments

  1. Its like you read my mind! You seem to know a lot about this, like you wrote the book in it or something.
    I think that you could do with some pics to drive the message home a bit,
    but other than that, this is great blog. An excellent read.
    I will certainly be back.

  2. Hi,

    thanks for this tutorial. I added a link to it on OXID forge:
    http://wiki.oxidforge.org/Tutorials#How_to_set_up_a_LAMP_Server_and_OXID_eShop_on_CentOS

    Regards
    Marco

Speak Your Mind