您现在的位置是:主页 > news > 三亚市海棠湾幵发建设有限公司网站/网页游戏

三亚市海棠湾幵发建设有限公司网站/网页游戏

admin2025/6/17 23:37:54news

简介三亚市海棠湾幵发建设有限公司网站,网页游戏,湖州做网站建设的公司,做挂件的网站2019独角兽企业重金招聘Python工程师标准>>> 我这台是centos6.5的32位机器 lamplinuxapachemysqlphp 0.为了方便先更换源 0.1 先清除原来的 yum clean all 0.2 进入存放源的文件夹 cd /etc/yum.repos.d 0.3 备份原有的源 mv ./CentOS-Base.repo ./CentOS-Base.repo.…

三亚市海棠湾幵发建设有限公司网站,网页游戏,湖州做网站建设的公司,做挂件的网站2019独角兽企业重金招聘Python工程师标准>>> 我这台是centos6.5的32位机器 lamplinuxapachemysqlphp 0.为了方便先更换源 0.1 先清除原来的 yum clean all 0.2 进入存放源的文件夹 cd /etc/yum.repos.d 0.3 备份原有的源 mv ./CentOS-Base.repo ./CentOS-Base.repo.…

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

我这台是centos6.5的32位机器

lamp=linux+apache+mysql+php

0.为了方便先更换源

    0.1 先清除原来的

yum clean all

    0.2 进入存放源的文件夹

cd /etc/yum.repos.d

    0.3 备份原有的源

mv ./CentOS-Base.repo ./CentOS-Base.repo.bak

    0.4 下载163源

wget http://mirrors.163.com/.help/CentOS6-Base-163.repo

    0.5 改成默认源

mv CentOS6-Base-163.repo CentOS-Base.repo

    0.6 更新缓存

yum makecache

    0.7 更新系统

yum update

1.配置防火墙,打开端口

vim /etc/sysconfig/iptables
#清空里边的内容,把下边的复制进去
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
#22端口是SSH远程登陆用的,必须开!!除非你不用SSH
#20和21口是FTP用的,如果你安装了ftp就要打开
#80是web服务器端口必须开。443是https端口,需要也要开
#3306是mysql数据库端口

重启防火墙使配置生效

#打开防火墙服务
service iptables start
#设置成开机启动
chkconfig iptables on

2.安装apache

yum install httpd
chkconfig httpd on

3.安装MySQL数据库

yum install mysql mysql-serverchkconfig mysqld onservice mysqld start

    设置数据库用户和密码

mysql_secure_installation

这一步注意:先回车,到输入密码环节,第一次先回车! 然后是“y“然后输入密码,再次确认,后边就都是”y“。

4.安装php

yum install phpyum install php-mysql php-gd libjpeg* php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-bcmath php-mhash libmcryptyum install php-xcacheservice httpd restart

5.配置阶段:

    5.1配置apache

vim /etc/httpd/conf/httpd.conf
ServerTokens Prod
#76行
KeepAlive On
#83行 
MaxKeepAliveRequests 500
#331行 
Options Includes ExecCGI FollowSymLinks
#338行 
AllowOverride All
#在”</IfModule>“下边填上
<ifmodule mod_deflate.c>
DeflateCompressionLevel 6
AddOutputFilter DEFLATE html xml js css jpg gif png php
</ifmodule>
#407行 
DirectoryIndex index.php index.html index.htm
#541行 
ServerSignature Off
#801行 
AddHandler cgi-script .cgi .pl
service httpd restart

    5.2配置php

vim  /etc/php.ini
#229行 
short_open_tag = On
#380行去掉分号,然后改成 
open_basedir = /var/www:/proc
#432行 
expose_php = Off
#440行 
max_execution_time = 60
#513行 
error_reporting = E_ALL & ~E_NOTICE
#530 
display_errors = On
#551 
log_errors = Off
#799 
doc_root = /var/www/html
#804 
user_dir = /var/www/html
#874行,去掉注释 
upload_tmp_dir = /var/www/tmp
#878 这个上传文件大小的限制你想改多大都行(默认2M太小了,wordpress都传不上去)
upload_max_filesize = 16M
#890 
allow_url_include = On
#946 去掉分号 
date.timezone = PRC
#1267 
session.save_path = "/var/www/tmp"
service httpd restart

    5.3配置MySQL

    先备份配置文件

cp /etc/my.conf /etc/my.conf_old
vim /etc/my.cnf
#清除里边的信息,复制下边的信息
[mysqld]
default-character-set = utf8
character_set_server=utf8
init_connect='SET NAMES utf8'
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
symbolic-links=0[mysqld_safe]
default-character-set = utf8
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid[client]
default-character-set = utf8[mysql.server]
default-character-set = utf8[mysql]
default-character-set = utf8
service mysqld restart
mkdir /var/www/tmp
service httpd restart

 

6.到这里就结束了!!欢呼三声:喵!喵!喵!

可是想把文件放到网站根目录里并且工作就要给目录权限!

这里特别要注意,下边的用户组内容在centos6下写成"apache.apache"就行,可是ubuntu16就不能这么写了,要写成"www-data.www-data"才可以!亲测!!!

vim chwww.sh
chown apache.apache -R /var/www
chmod 744 -R /var/www

保存!

然后运行一下就OK啦!

/root/chwww.sh

 

 

好了全部完成了!有问题欢迎留言评论!

转载于:https://my.oschina.net/finchxu/blog/1571132