wordpress配置通过IP直接访问及apache的配置
wordpress配置通过IP直接访问
环境:
操作系统:centos6.5
yum安装lamp环境:
yum -y install mysql mysql-server php php-mysql httpd php-gd* freetype freetype-devel libmcrypt libmcrypt-devel mcrypt mhash php-mcrypt
apache版本:2.2.15
wordpress程序目录:/var/www/html/wordpress/
1.直接编辑vim /etc/httpd/conf/httpd.con中的DocumentRoot即可
DocumentRoot "/var/www/html/wordpress"
2.虚拟主机方式:
vim /etc/httpd/conf.d/vhosts.conf
加入如下内容:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot /error
ServerName error.com
</VirtualHost>
<Directory "/var/www/html/wordpress/">
php_admin_value open_basedir "/var/www/html/wordpress/:/tmp/"
Options Includes ExecCGI FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<VirtualHost *:80>
DocumentRoot /var/www/html/wordpress/
ServerName 192.168.1.22:80
</VirtualHost>
环境:
操作系统:centos6.5
yum安装lamp环境:
yum -y install mysql mysql-server php php-mysql httpd php-gd* freetype freetype-devel libmcrypt libmcrypt-devel mcrypt mhash php-mcrypt
apache版本:2.2.15
wordpress程序目录:/var/www/html/wordpress/
1.直接编辑vim /etc/httpd/conf/httpd.con中的DocumentRoot即可
DocumentRoot "/var/www/html/wordpress"
2.虚拟主机方式:
vim /etc/httpd/conf.d/vhosts.conf
加入如下内容:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot /error
ServerName error.com
</VirtualHost>
<Directory "/var/www/html/wordpress/">
php_admin_value open_basedir "/var/www/html/wordpress/:/tmp/"
Options Includes ExecCGI FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<VirtualHost *:80>
DocumentRoot /var/www/html/wordpress/
ServerName 192.168.1.22:80
</VirtualHost>
访问报错:
解决:
http://192.168.1.22/wp-admin登陆后台修改即可