Apache常用配置
2014-03-07 00:00
211 查看
查看Apache运行用户和组
只需要运行一下命令即可知道
ps -ef |grep httpd
ps -ef |grep apache2
运行之后就显示了httpd进程的运行用户
当然也可以通过查看apache的httpd.conf配置文件来查看apache运行用户和组.
关于虚拟机中的 Web Server
在读取纯静态文件时可能会出现缓存问题。例如 Apache 的 conf 里需要加上这么两行来修正
EnableMMAP Off
EnableSendfile Off
Apache Log
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel debug
CustomLog ${APACHE_LOG_DIR}/access.log combined
For debugging mod_rewrite issues, you'll want to use RewriteLogLevel and RewriteLog:
it is important to make sure that everyone will be able to read your new files.
只需要运行一下命令即可知道
ps -ef |grep httpd
ps -ef |grep apache2
运行之后就显示了httpd进程的运行用户
当然也可以通过查看apache的httpd.conf配置文件来查看apache运行用户和组.
关于虚拟机中的 Web Server
在读取纯静态文件时可能会出现缓存问题。例如 Apache 的 conf 里需要加上这么两行来修正
EnableMMAP Off
EnableSendfile Off
Apache Log
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel debug
CustomLog ${APACHE_LOG_DIR}/access.log combined
For debugging mod_rewrite issues, you'll want to use RewriteLogLevel and RewriteLog:
RewriteLogLevel 3 RewriteLog "/usr/local/var/apache/logs/rewrite.log"
How To Set Up Apache Virtual Hosts on Debian 7
sudo mkdir -p /var/www/example.com/public_html
sudo chown -R $USER:$USER /var/www/example.com/public_html
it is important to make sure that everyone will be able to read your new files.
sudo chmod -R 755 /var/www
sudo nano /var/www/example.com/public_html/index.html
sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/example.com
sudo nano /etc/apache2/sites-available/example.com
<VirtualHost *:80> ServerAdmin webmaster@example.com ServerName example.com ServerAlias www.example.com [...] DocumentRoot /var/www/example.com/public_html
sudo a2ensite example.com
sudo service apache2 restart
相关文章推荐
- 第四篇(1):企业常用Linux web环境安装配置(apache、php、mysql)
- php、Apache网站常用安全配置
- Apache Rewrite规则配置常用语法介绍
- 【转】apache常用配置
- apache常用配置
- apache安全配置及常用配置
- Apache、Web软件、Apache安装、常用配置项、区域配置、日志分析
- 阿里云Ubuntu系统从0搭建LAMP(Apache+MySQL+PHP)以及服务器生产环境常用配置
- apache常用配置
- Apache常用目录详解、配置文件详解及优化、配置文件权限详解
- 阿里云Ubuntu系统从0搭建LAMP(Apache+MySQL+PHP)以及服务器生产环境常用配置
- apache常用的配置指令:ServerName
- apache常用配置
- Apache运维中常用功能配置笔记梳理
- 详解Apache下.htaccess文件常用配置
- Apache的几种常用配置
- apache常用的配置指令:Listen
- Apache常用配置
- apache本地配置虚拟主机httpd-vhosts.conf常用
- apache配置常用模块