1.系统环境
centos 6.5
yum 命令包
网络
2.安装组件
- 安装Apahce, PHP, MySQL以及php连接mysql库组件。
yum -y install httpd php mysql mysql-server php-mysql
- 安装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
- 安装MySQL的扩展
yum -y install mysql-connector-odbc mysql-devel libdbi-dbd-mysql
3.启动服务
/sbin/service httpd start
/sbin/service mysqld start
4.必要介绍
部分配置
#httpd配置
vim /etc/httpd/conf/httpd.conf
#Options Indexes FollowSymLinks//显示文件目录结构
Options FollowSymLinks//不显示文件目录结构
web index 路径
/var/www/html/index.html
或者
/var/www/html/index.php
5.FTP(vsftpd)
set
#l添加用户
useradd -d /home/test test #路径 用户名
passwd test
chmod 777 /home/test #开放权限
usermod -d /test test #更改用户主目录为
#l匿名访问开关
anonymous_enable=NO
#默认路径var/ftp/
#l资源管理器访问需要设置被动模式
vi /etc/vsftpd/vsftpd.conf //编辑配置文件
connect_from_port_20=NO
pasv_enable=YES
pasv_promiscuous=NO
pasv_min_port=3000
pasv_max_port=6000
pasv_address=8.210.***.***
listen=YES
listen_ipv6=NO
#l主动模式
vi /etc/vsftpd/vsftpd.conf //编辑配置文件
connect_from_port_20=YES
#pasv_enable=YES
#pasv_promiscuous=NO
#pasv_min_port=3000
#pasv_max_port=6000
#pasv_address=8.210.***.***
listen=NO
listen_ipv6=YES
#l其他配置
local_root=/ #表示使用本地用户登录到ftp时的默认目录
anon_root=/ #表示匿名用户登录到ftp时的默认目录
#l重启ftp
systemctl restart vsftpd
#l登陆账户
ftp://username:password@8.210.*.*:21 #账号
ftp://8.210.*.* #匿名
6.PHP
#配置大文件上传
vi /etc/php.ini
##编辑
max_execution_time = 600
max_input_time = 600
memory_limit = 512m
file_uploads = on
upload_tmp_dir = /tmp
upload_max_filesize = 512m
post_max_size = 512m
##重启
systemctl restart httpd
7.额外安装例子(其他高级版本)
#yum安装mysql5.7
set
#安装mysql源:
yum -y localinstall http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm
yum repolist enabled | grep "mysql.*-community.*"
#安装mysql:
yum -y install mysql-community-server mysql-community-devel
#查看mysql的root账号的密码
grep 'temporary password' /var/log/mysqld.log
#启动mysql服务
service mysqld start
#登录mysql
mysql -uroot -p
#修改mysql密码系列步骤
find / -name mysql #一个个找配置文件可能在的位置
vi /etc/logrotate.d/mysql #通过这里找到/etc/my.cnf
cd etc;vi my.cnf;(添加:skip-grant-tables) :wq #允许不用密码登陆
service mysqld restart;mysql -uroot -p; #重启,登陆MySQL
use mysql;
update user set authentication_string=password('ABCabc123!') where user='root' and host='loacalhost'; #重置密码
flush privileges;
quit
vi my.cnf;(更改为:#skip-grant-tables) :wq #需要用密码登陆
service mysqld restart;//重启
#解决 ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
set global validate_password_policy=0;
set global validate_password_length=1;
#修改密码
alter user 'root'@'localhost' identified by '123456';
#修改root用户可远程登录
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
#刷新
flush privileges;
#yum安装php7.1
set
#安装php源:
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
#检查源是否安装成功;
yum repolist enabled | grep "webtatic*"
#安装php扩展源:
yum -y install php71w php71w-fpm
yum -y install php71w-mbstring php71w-common php71w-gd php71w-mcrypt
yum -y install php71w-mysql php71w-xml php71w-cli php71w-devel
yum -y install php71w-pecl-memcached php71w-pecl-redis php71w-opcache
#验证php是否安装成功
php -v
#验证对应的扩展是否安装成功
php -m
#启动php-fpm
service php-fpm star
#检查启动是否成功
service php-fpm status
#设置开机自启动:
systemctl enable php-fpm.service
#检查开机自启动是否设置成功:
systemctl list-dependencies | grep php-fpm
ps -ef | grep php-fpm
8.常用命令
#linux系列
set
#查询与卸载
rpm -qa | grep mysql
rpm -e pack-full-name
#开关防火墙
systemctl restart/start/stop firewalld.service
#启动mysql:
service mysqld start
#检查mysql启动是否正常:
service mysqld status 或者 ps -ef | grep mysql
#查看ssr日记
cat /usr/local/shadowsocksr/shadowsocks/ssserver.log
#查找程序路径
php -i | grep php.ini
#设置mysqld服务开机自启动:
systemctl enable mysqld.service
#检查mysqld开机自启动是否设置成功:
systemctl list-dependencies | grep mysqld
#Your password does not satisfy policy requirements
set global validate_password_policy=0;
set global validate_password_length=1;
9.其他
SSR一键脚本:
wget -N --no-check-certificate https://raw.githubusercontent.com/ToyoDAdoubi/doubi/master/ssr.sh && chmod +x ssr.sh && bash ssr.sh
10.参考文献
https://www.cnblogs.com/nulige/p/9382064.html
常用命令
https://zhuanlan.zhihu.com/p/43269674
https://www.cnblogs.com/xuxinstyle/p/9609551.html
https://blog.csdn.net/luansj/article/details/97272672
数据库常用命令
https://www.cnblogs.com/bluealine/p/7832219.html