# 安装Apache+MySQL+PHP
yum -y install httpd php mysql mysql-server php-mysql zip unzip
# 启动httpd服务
service httpd start
# 启动mysql服务
service mysqld start
# 设置mysql数据库root帐号密码,引号内填密码
mysqladmin -u root password '自己的密码'
# 安装apache扩展
yum -y install httpd-manual mod_ssl mod_perl mod_auth_mysql
# 安装php的扩展
yum -y install php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc php-bcmath
# 安装mysql扩展
yum -y install mysql-connector-odbcmysql-devel libdbi-dbd-mysql
挂载磁盘:
fdisk /dev/sdb
mkfs -t ext4 /dev/sdb1
mkdir /extends
mount /dev/sdb1 /extends
vi /etc/fstab
安装ftp服务器:
yum install vsftpd
/usr/sbin/adduser -d /可以是home/ftp -s /sbin/nologin ftpuser
passwd ftpuser
chmod 775 /home/ftp
开启mysql远程链接:
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'cuit2010211079..' WITH GRANT OPTION;
FLUSH PRIVILEGES;
修改配置文件:
vi /etc/httpd/conf/httpd.conf
vi /etc/my.cnf
vi /etc/php.ini
vi /etc/sysconfig/iptables
-A INPUT -p tcp --dport 80 -j ACCEPT
-I INPUT -p tcp --dport 3306 -j ACCEPT
/var/lib/mysql
setenforce 0
cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c cpu信息
df -h 磁盘
my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
key_buffer_size = 128M
max_allowed_packet = 1M
table_open_cache = 1024
sort_buffer_size = 1M
net_buffer_length = 8K
read_buffer_size = 512K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid