根目录下记得添加.htaccess
CentOS 6.5 64 Bit
首先yum安装lamp.
官方停止更新CentOS6之后手工更新yum源
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo-backup
wget -O /etc/yum.repos.d/CentOS-Base.repo http://file.kangle.odata.cc/repo/Centos-6.repo
wget -O /etc/yum.repos.d/epel.repo http://file.kangle.odata.cc/repo/epel-6.repo
yum makecache
yum update
yum install httpd
ifconfig eth0 | grep inet | awk ‘{ print $2 }’
echo ‘ServerName 127.0.0.1’ >> /etc/httpd/conf/httpd.conf
iptables -F
firewall-cmd –zone=public –add-port=80/tcp –permanent
firewall-cmd –reloadservice httpd restart
ip访问 “It works!”
yum install mysql-server
service mysqld start
/usr/bin/mysql_secure_installation
回车
y
设置mysql root密码
yum install php php-mysql
yum search php-
yum info name of the module
sudo yum install name of the module
sudo chkconfig httpd on
sudo chkconfig mysqld on
sudo service httpd restart
enable mod_rewrite on Apache
grep -i AllowOverride /etc/httpd/conf/httpd.conf
修改所有AllowOverride None为AllowOverride All
sudo service httpd restart
查看mod_headers是否已经安装
apachectl -t -D DUMP_MODULES
yum install perl-CGI perl-libwww-perl.noarch perl-DBI perl-DBD-MySQL perl-GD perl-Cache-Memcached
LWP::Protocol::https 安装
yum install perl-Crypt-SSLeay
yum install perl-Digest-SHA
chmod 777 Templates/static logs temp uploads
chmod 666 XFSConfig.pm XFileConfig.pm ipn_log.txt logs.txt
chmod 755 api.cgi cron.pl cron_deleted_email.pl dl.cgi fs.cgi index.cgi index_box.cgi index_dl.cgi ipn.cgi transfer.pl up.cgi upload.cgi uu.cgi
yum install php-mbstring
关闭SELinux
临时方法:使用命令setenforce 0
yum install gcc make build-essential
yum install perl-CPAN
perl -MCPAN -e shell
install CPAN
reload cpan
perl -MCPAN -e shell
install MIME::Base64
install Authen::SASL
install XML::Simple
exit
Using Cloudflare with XFileSharing
point the direct IP of your main server in /etc/hosts file
86.107.110.126 xxxfile.com www.xxxfile.com
Make sure that IPv6 is disabled in Cloudflare settings
Open XFileConfig.pm and set ‘accept_cf_connecting_ip’ to ‘1’
mkdir -p /home/backup
chmod 777 -R /home/backup
crontab -e
0 * * * * cd /home/wwwroot/jolinfile/cgi-bin;./cron.pl >/dev/null 2>&1
0 0 * * * cd /home/wwwroot/jolinfile/cgi-bin;./cron_deleted_email.pl >/dev/null 2>&1
* * * * * cd /home/wwwroot/jolinfile/cgi-bin;./transfer.pl >/dev/null 2>&1
34 * * * * bash /home/wwwroot/backup.sh > /dev/null 2>&1
* * * * * ps -A -o stat,ppid,pid,cmd | grep -e ‘^[Zz]’ | awk ‘{print $2}’ | xargs kill -9
CentOS7中关闭selinux
临时关闭
setenforce 0
此时的状态如下
sestatus
-
[root@rdo ~]# sestatus
-
SELinux status: enabled
-
SELinuxfs mount: /sys/fs/selinux
-
SELinux root directory: /etc/selinux
-
Loaded policy name: targeted
-
Current mode: permissive
-
Mode from config file: enforcing
-
Policy MLS status: enabled
-
Policy deny_unknown status: allowed
-
Max kernel policy version: 28
永久关闭
sed -i ‘/SELINUX/s/enforcing/disabled/’ /etc/selinux/config
修改完成后,保存重启,重启后状态如下:
sestatus
SELinux status: disabled
