Kiểm tra hostname hiện tại
#hostname
Đổi sang hostname mới vi du: quantrihethong.net
echo “HOSTNAME=quantrihethong.net” >> /etc/sysconfig/network
hostname “quantrihethong.net”
Thay đổi trong file /etc/hostssudo nano /etc/hosts
Thay đổi thông tin IP và hostname#ipvps quantrihethong.net localhost
Khởi động lại server#reboot
yum install httpd -y
#service iptables save
#service iptables restart
Test thử bằng cách truy cập vào http://<youraddress> bạn sẽ thấy thông báo “Apache 2 Test Page”
#yum install mysql-server -y
#service mysqld start
Tiến hành cài đặt MySQL bằng lệnh#/usr/bin/mysql_secure_installation
Do mới cài đặt nên nếu bị hỏi password bạn nhấn EnterEnter current password for root (enter for none):
OK, successfully used password, moving on…
Sau đó cần đặt root password bằng cách chọn yTiếp theo bạn sẽ phải trả lời một loạt các câu hỏi, tốt nhất cứ chọn y
By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] y
… Success!
Normally, root should only be allowed to connect from ‘localhost’. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] y
… Success!
By default, MySQL comes with a database named ‘test’ that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] y
– Dropping test database…
… Success!
– Removing privileges on test database…
… Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] y
… Success!
Cleaning up…
All done! If you’ve completed all of the above steps, your MySQL
installation should now be secure.
Thanks for using MySQL!
#chkconfig mysqld on
#yum -y install php-mysql
Cài Thêm Modun cho php
#yum -y install php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-mssql php-snmp php-soap php-tidy curl curl-devel
Khởi động lại apache
service httpd restart
Tao file info.php trong /var/www/html với nội dung:
+ Buoc 5: Cài Đặt phpMyadmin
cd /var/www/html
wget http://jaist.dl.sourceforge.net/project/phpmyadmin/phpMyAdmin/4.2.6/phpMyAdmin-4.2.6-english.zip
unzip phpmyadmin.zip
vi /usr/share/phpmyadmin/config.inc.php
Tìm đến dòng:
/* Authentication type */
$cfg[‘Servers’][$i][‘auth_type’] = ‘cookie‘;
[…]
/* Authentication type */
$cfg[‘Servers’][$i][‘auth_type’] = ‘http‘;
[…]