How to enable additional repositories
You have to install mod_fastcgi after sometime which can be obtained in the RPMforge repositories. In order to enable RPMforge, follow the given code:
rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
rpm -ivh rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
Installing MySQL 5
In order to install MySQL, write the following code:
yum install mysql mysql-server
After that make the system startup links for MySQL. By doing this, MySQL will boot automatically every time the system starts. Now, launch the MySQL server:
systemctl enable mysqld.service
systemctl start mysqld.service
Create passwords for the MySQL root account:
[root@server1 ~]# mysql_secure_installation
One thing that should be remembered is that by running every part of this scrip is highly recommended for all MySQL servers in production use. Now, follow each step warily.
You will need to have an existing password for the root user, if you want to log into MySQL to secure it. In case, you have recently installed MySQL, and you still have to create the root password, then it will show a blank space. Now, click on enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on...
By creating the root password will enable only authorized people to log into MySQL root user.
Set root password? [Y/n] <-- ENTER
New password: <-- yourrootsqlpassword
Re-enter new password: <-- yourrootsqlpassword
Password updated successfully!
Reloading privilege tables..
There is a by default option of an anonymous user in MySQL installation, which eventually allow anyone to log into MySQL even if he/she hasn’t any user account. It is because for testing purpose only, and to smoothly run the installation process. You have to delete them before going into a production environment.
Remove anonymous users? [Y/n] <-- ENTER
Usually, root is only connected from ‘localhost’. This is intended because to shun anyone from guessing root password from the network.
Disallow root login remotely? [Y/n] <-- ENTER
MySQL has a built in database name as ‘test’. It allows everyone to access it. It is used only for testing, and once you move into a production environment, it should be removed then.
Remove test database and access to it? [Y/n] <-- ENTER
- Dropping test database...
- Removing privileges on test database...
When the privilege tables are reloaded, it guarantees that all changes that have been up till now are successfully done.
Reload privilege tables now? [Y/n] <-- ENTER
The process is now completed, and your MySQL installation is now protected.
Apache2 can be found in Fedora package, so we can install it in this way:
yum install httpd
You have to configure your system now in order to launch Apache at boot time…
systemctl enable httpd.service
Now start Apache:
systemctl start httpd.service
Now, write this on your browser http://192.168.0.100. By doing this, you will be able to see the Apache2 pageholder page:
We can make PHP5 work in Apache2 through PHP-FPM and Apache's mod_fastcgi module. We install it according to the given procedure like this:
yum install mod_fastcgi php-fpm
Then open /etc/php.ini:
In order to keep away from this type of error
[08-Aug-2011 18:07:08] PHP Warning: phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead in /usr/share/nginx/html/info.php on line 2
... in /var/log/php-fpm/www-error.log when you call a PHP script in your browser, you should set date.timezone in /etc/php.ini:
; Defines the default timezone used by the date functions
date.timezone = "Europe/Berlin"
In order to find out accurate timezone for your system, run this:
[root@server1 ~]# cat /etc/sysconfig/clock
Now, mkake the system startup links for php-fpm and start it:
systemctl enable php-fpm.service
systemctl start php-fpm.service
Now, restart Apache:
systemctl restart httpd.service