*************
*** MySql ***
*************
Setup:
yum install mysql mysql-server
扩展:
yum install mysql-connector-odbc mysql-devel libdbi-dbd-mysql
Start:
/etc/init.d/mysqld start
Check:
netstat -tap | grep mysql
Files:
vim /etc/my.cnf
注释掉 #skip-networking, /etc/init.d/mysqld restart
/var/lib/mysql/ // stores databases
Root passwd:
mysql_secure_installation
[root@server1 ~]# mysql_secure_installation
Enter current password for root (enter for none): <– 回车
Set root password? [Y/n] <– 回车
New password: <– 设置你的root密码
Re-enter new password:
Password updated successfully!
Remove anonymous users? [Y/n] <– 回车
… Success!
Disallow root login remotely? [Y/n] <– 回车
… Success!
Remove test database and access to it? [Y/n] <–回车
- Dropping test database…
… Success!
- Removing privileges on test database…
… Success!
Reload privilege tables now? [Y/n] <– 回车
… Success!
Cleaning up…
All done!
或者 mysqladmin -u root password PASSWORD_HERE
再或者:
USE mysql;
UPDATE user SET Password=PASSWORD("your password") WHERE User="root";
FLUSH PRIVILEGES;
解决MySQL表名大小写敏感
vim /etc/my.cnf
在mysqld这一块的末尾添加如下一句:
lower_case_table_names=1
service mysqld restart
**************
*** Apache ***
**************
Setup:
yum install httpd
yum install httpd-manual mod_ssl mod_perl mod_auth_mysql //extension
【Configure】
1. Set the apache service to start on boot
chkconfig --levels 235 httpd on
or
ntsysv -> check "httpd"
2. Enable name-based virtual hosting on port 80
vim /etc/httpd/conf/httpd.conf //Replace ServerName with ServerName xxx
Uncomment the line containing the text NameVirtualHost *:80
service httpd restart
【Directory list】
/etc/httpd/conf/httpd.conf //main configuration file
/etc/httpd/conf.d/*.conf //extra configuration file
/usr/lib/httpd/modules/
/var/www/html/ // stores webpage
/var/www/error/ // stores webpage error
/var/www/cgi-bin // stores cgi-program of webpage
/var/log/httpd/ // log
/usr/sbin/apachectl // start stop restart...
/usr/bin/htpasswd // apache passwd
权限问题:
注意selinux的是否开启
关闭: setenforce 0
外界无法访问:
关闭iptables: service iptables stop
或 vi /etc/sysconfig/iptables 让防火墙开放80端口, 添加:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT // seems doesn't work!
*************
**** PHP ****
*************
Setup:
yum install php phpMyAdmin php-fpm php-cli php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-eaccelerator php-magickwand php-magpierss php-mapserver php-mbstring php-mcrypt php-mssql php-shout php-snmp php-soap php-tidy
Config:
/etc/php.ini
cgi.fix_pathinfo=0 //补漏洞
Dynamic Extension:(Check /usr/lib/php/modules/)
extension=mbstring.so
extension=gd.so
extension=xml.so
********************
**** phpMyAdmin ****
********************
vim /etc/phpMyAdmin/config.inc.php // 修改phpMyAdmin参数,使用cookie模式登录
$cfg['blowfish_secret'] = 'ThisIsForCookieAuth';
$cfg['Servers'][$i]['controluser'] = 'root'; // MySQL root
$cfg['Servers'][$i]['controlpass'] = '123'; // MySQL root 密码
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = 'will'; // mysql account: will
$cfg['Servers'][$i]['password'] = 'will's passwd';
进入phpmyadmin管理页面
username: will
password: will's passwd
Test:
vim /var/www/html/index.php
phpinfo();
?>
*************
*** nginx ***
*************
Setup:
yum install nginx
Start:
/etc/init.d/nginx start
Check:
阅读(1291) | 评论(0) | 转发(0) |