1. Install MySQL
# yum install mysql mysql-serverAdding MySQL to startup
# chkconfig --levels 235 mysqld onCreate MySQLadmin User and Password
# /etc/init.d/mysqld start
# mysqladmin -u root password YourPassSQLYou can find HostNameServer on terminal console [root@HostNameServer ~]#
# mysqladmin -h HostNameServer -u root password YourPassSQL
2. Install Apache.
# yum -y install httpdAdding Apache to startup, so it can automatic loaded if system restarted.
# chkconfig --levels 235 httpd on
# service httpd start
To check Apache has installed on server go to http://YourIPAddress/ and if you see as in the screenshoot that means Apache has been installed on your server.If you get message "No Route To Host" that means you must open port 80 that still closed by firewall.
To open port 80 simply do this step:
# vi /etc/sysconfig/iptablesAdd this command and save (to save press key "Esc" and then type ":wq")
-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 80 -j ACCEPTAnd then restart IPTABLES
# service iptables restart
3. Install PHP
# yum install php php-mysql php-mbstring php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpcRestart Apache
# service httpd restartTo check php has been installed on server simply do following step:
# vi /var/www/http/php/index.phpand type following php code:
<?phpSave and go to http://YourIPAddress/php
phpinfo();
?>
if php has been installed on your server, you will see a page like this:
DONE!!!
Now you can build a website on your server.
No comments:
Post a Comment