关于我们

质量为本、客户为根、勇于拼搏、务实创新

< 返回新闻公共列表

LINUX服务器下APACHE的常见操作

发布时间:2022-11-18 11:50:50

1.apache 主目录
/usr/local/apache2

2.网站主目录

/usr/local/apache2/htdocs
3.配置文件
/usr/local/apache2/etc/httpd.conf


4.应用程序
/usr/local/apache2/bin/httpd


5.服务脚本
/usr/local/apache2/bin/apachectl


6.启动服务
/usr/local/apache2/bin/apachectl start
/usr/local/apache2/bin/apachectl restart


7.关闭服务
/usr/local/apache2/bin/apachectl stop


8.查看进程
pstree |grep httpd


9.查看端口
netstat -tunpl |grep :80


10.开机启动
vi /etc/rc.d/rc.local
/usr/local/apache2/bin/apachectl restart &>/dev/null

 

apache  配置文件:

1.监听端口
Listen 800


2.加载 php 的动态模块
LoadModule php5_module modules/libphp5.so


3.apache 服务的进程执行者
User daemon


4.apache 的网站根目录
DocumentRoot "/usr/local/apache2/htdocs"


5.apache 的网站根目录的服务权限

Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
#先允许,后拒绝
Allow from all
#允许所有人
#不拒绝任何人


6.apache 的默认首页
DirectoryIndex index.php index.html


7.apache 的错误日志
ErrorLog "logs/error_log"


8.apache 的访问日志
CustomLog "logs/access_log" common
实时查看文件中的最后十行的变化:
tail -f access_log


9.404 页面不存在
ErrorDocument 404 /missing.html


10.包含外部配置文件
Include etc//extra/httpd-vhosts.conf



/template/Home/Zkeys/PC/Static