Sei sulla pagina 1di 7

How to Install Apache, MySQL, and PHP on CentOS 6.

7 - ZeroStopBits

1 sur 7

https://www.zerostopbits.com/how-to-install-apache-mysql-and-php-o...

yum -y upgrade && yum -y install nano

nano /etc/sysconfig/selinux

SELINUX=enabled

27/07/2016 11:49

How to Install Apache, MySQL, and PHP on CentOS 6.7 - ZeroStopBits

2 sur 7

https://www.zerostopbits.com/how-to-install-apache-mysql-and-php-o...

SELINUX=disabled

nano /etc/resolv.conf

nameserver 8.8.8.8
nameserver 8.8.4.4

shutdown -r now

yum -y install httpd mysql mysql-server php wget ntp

httpd-2.2
php-5.3
mysql-5.1
ntp-4.2
wget-1.12

27/07/2016 11:49

How to Install Apache, MySQL, and PHP on CentOS 6.7 - ZeroStopBits

3 sur 7

https://www.zerostopbits.com/how-to-install-apache-mysql-and-php-o...

chkconfig ntpd on
ntpdate pool.ntp.org
service ntpd start

mkdir -p /var/www/virtual/
chown -R apache:apache /var/www/virtual/
chmod -R 755 /var/www/virtual/

nano /etc/httpd/conf/httpd.conf

ServerName serverhostname.yourdomain.com:80 (enter your server hostname here)


DirectoryIndex index.html index.html.var index.php

27/07/2016 11:49

How to Install Apache, MySQL, and PHP on CentOS 6.7 - ZeroStopBits

4 sur 7

https://www.zerostopbits.com/how-to-install-apache-mysql-and-php-o...

ServerSignature Off
ServerTokens Prod

chkconfig httpd on
service httpd start

nano /etc/sysconfig/iptables

-A INPUT -i lo -j ACCEPT

-A INPUT -m tcp -p tcp --dport 80 -j ACCEPT

service iptables restart

chkconfig mysqld on
service mysqld start

27/07/2016 11:49

How to Install Apache, MySQL, and PHP on CentOS 6.7 - ZeroStopBits

5 sur 7

https://www.zerostopbits.com/how-to-install-apache-mysql-and-php-o...

mysql_secure_installation

[root@vps ~]# mysql_secure_installation


Enter current password for root (enter for none):
OK, successfully used password, moving on...
Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!
Remove anonymous users? [Y/n] y
... Success!
Disallow root login remotely? [Y/n] y
... Success!
Remove test database and access to it? [Y/n] y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
Reload privilege tables now? [Y/n] y
... Success!

27/07/2016 11:49

How to Install Apache, MySQL, and PHP on CentOS 6.7 - ZeroStopBits

6 sur 7

https://www.zerostopbits.com/how-to-install-apache-mysql-and-php-o...

27/07/2016 11:49

How to Install Apache, MySQL, and PHP on CentOS 6.7 - ZeroStopBits

7 sur 7

https://www.zerostopbits.com/how-to-install-apache-mysql-and-php-o...

27/07/2016 11:49

Potrebbero piacerti anche