Installation on Fedora : step-by-step

Permalink
Hi
We recently migrated a dev website to final host, and the client wanted a step-by-step cheat sheet because they could not succeed. Our admin Dmitri wrote it. So here it is, as it might help someone. We were starting with a brand new Fedora 13 install on slicehost.com

Update all software
yum update


Install LAMP
yum install httpd mysql mysql-server php php-mysql phpmyadmin


After installation, the services must be configured to start automatically.
chkconfig httpd on 
chkconfig mysqld on


Secure Apache
Open the file /etc/httpd/conf/httpd.conf and alter the directives:
ServerTokens Prod 
ServerSignature Off 
TraceEnable Off


Secure PHP
Open /etc/php.ini and alter the following values:
safe_mode = Off 
register_globals = Off 
expose_php = Off 
allow_url_fopen = Off 
allow_url_include = Off 
enable_dl = Off 
disable_functions="popen,exec,system,passthru,proc_open,shell_exec,show_source,phpinfo,eval" 
session.use_only_cookies = 1 
log_errors = On 
display_errors = Off 
error_log = /var/log/phperror.log 
memory_limit = 128M 
post_max_size = 8M 
upload_max_filesize = 2M 
max_execution_time = 30


All PHP errors will be stored in file /var/log/phperror.log. The following lines create it and set the permissions:
touch /var/log/phperror.log 
chmod 666 /var/log/phperror.log


Restart Apache to make changes to take effect:
/etc/init.d/httpd restart


Secure MySQL
Run from shell:
mysql_secure_installation 
Set root password? [Y/n] y 
Remove anonymous users? [Y/n] y 
Disallow root login remotely? [Y/n] y 
Remove test database and access to it? [Y/n] y 
Reload privilege tables now? [Y/n] y


Secure phpMyAdmin
Open file nano /etc/httpd/conf.d/phpMyAdmin.conf and add before the line:
Allow from 127.0.0.1 
add the IP of your allowed host(s): 
Allow from ip.address


Restart httpd
/etc/init.d/httpd restart


Open in browser for testing the url, exemplehttp://yourhost.tld/phpmyadmin/...

Install ConfigServer Security & Firewall
yum install perl-libwww-perl 
wget http://www.configserver.com/free/csf.tgz 
tar xvf csf.tgz 
cd csf 
sh install.sh 
cd ..; rm -rf csf*


Configure service to start automatically
chkconfig csf on


Disable testing mode for CSF. In file /etc/csf/csf.conf modify the line:
TESTING = "1"

with
TESTING = "0"


Save the file and start CSF
/etc/init.d/csf start


Migrate Concrete 5 CMS
Create MySQL database user and password for concrete CMS
mysql -p 
CREATE DATABASE databasename; 
GRANT ALL ON databasename.* TO 'user_name'@localhost IDENTIFIED BY 'user_password'; 
FLUSH PRIVILEGES;


Using phpmyadmin and created credentials, upload the database

Tune PHP (otherwise C5 will not work). Open /etc/php.ini and set:
short_open_tag = On


Move all files to the document root of virtual host. Before that, you will have disabled cache in C5 admin, emptied it and disabled pretty URLs. If you forget to empty cache, you can do it at a later stage by emptying /files/cache etc.

Open the file config/site.php and look for the lines to match these:
define('DB_SERVER', '127.0.0.1'); 
define('DB_USERNAME', 'user_name'); 
define('DB_PASSWORD', 'user_password'); 
define('DB_DATABASE', 'database_name'); 
define('BASE_URL', 'http://yourdomain.tld); 
define('DIR_REL', '');


Configure mod_rewrite
To enable mod_rewrite. Open vhost config file and replace:
AllowOverride None

with
AllowOverride All


In Concrete5 document root fit .htaccess with following contents to allow clean urls:
<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteBase / 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php/$1 [L] 
</IfModule>


Make sure /files/cache and /files/ are writable by server (with ownership) if not CHMOD them 777 recursively.

Open in browser to test.

witwag
 
Mnkras replied on at Permalink Reply
Mnkras