我在/ var / www / site1和/ var / www / site2文件夹中有虚拟主机。 我想限制对apache虚拟主机文档根目录以外的文件的访问,即site1不能访问site2的文件。 现在这个脚本在/ var / www / site1下工作正常,这不好: $filename = "/var/www/site2/somefile"; $handle = fopen($filename, "r"); $contents = fread($handle, filesize($filename)); echo $contents; 请问如何解决这个问题? 非常感谢你!
我有lampp和wordpress正确安装。 当我尝试导航到http://localhost/phpmyadmin我得到了403权限被拒绝的错误。 我可以访问我的虚拟主机configuration中可用的两个站点。 虽然我不完全确定所有选项在我的虚拟主机configuration文件中做了什么,所以我认为他们搞砸了一些phpmyadmin。 例如,当我导航到本地主机时,我得到以下错误信息,这可能意味着我做了错误的事情(没有任何wordpress安装链接在/var/www/ ): “无论是/etc/wordpress/config-localhost.php还是/etc/wordpress/config-localhost.php都不能find。确保其中一个存在,可以被web服务器读取并且包含正确的密码/用户名。 我的两个站点在/var/www/中可用,文件系统布局如下所示: -site1 —web (public html – symbolic link to /usr/share/wordpress) —uploads -site2 —web (public html – symbolic link to /usr/share/wordpress) —uploads phpmyadmin已经通过Ubuntu 12.04存储库安装,就像其他所有的一样,并在安装过程中自动configuration(这应该只是导航到http://localhost/phpmyadmin/但我可能打破了这一点,而configuration其余)。 这就是我configuration虚拟主机的方式(这些设置适用于两个站点,只是不同的域): <VirtualHost *:80> ServerAdmin [email protected] ServerName site1.com ServerAlias www.site1.com ErrorLog /var/log/apache2/site1.com/error.log CustomLog /var/log/apache2/site1.com/access.log combined DocumentRoot /var/www/site1.com/web <Directory /> Options -Indexes FollowSymLinks AllowOverride None </Directory> <Directory […]
我有local.domain.com和lmarket.local.domain.com从etc / hosts指向我的本地主机。 问题是我在Windows 7上使用XAMPP,在我的apacheconfiguration中有两个SSL VirtualHosts,但是无论我访问哪一个,我都被带到local.domain.com 。 在非HTTPS请求一切正常,虚拟主机基本相同。 这是我的鬼魂的相关部分: <VirtualHost local.domain.com:443> DocumentRoot "C:/xampp/htdocs/local" ServerName local.domain.com ServerAdmin webmaster@localhost ErrorLog "logs/error.log" <IfModule log_config_module> CustomLog "logs/access.log" combined </IfModule> SSLEngine on SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL SSLCertificateFile "conf/ssl.crt/server.crt" SSLCertificateKeyFile "conf/ssl.key/server.key" <FilesMatch "\.(cgi|shtml|pl|asp|php)$"> SSLOptions +StdEnvVars </FilesMatch> <Directory "C:/xampp/cgi-bin"> SSLOptions +StdEnvVars </Directory> BrowserMatch ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0 CustomLog "logs/ssl_request.log" "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x […]
我正在尝试将为Apache编写的应用程序(或.htaccess-files)迁移到Nginx,而且我遇到了一个问题,我无法将其包裹起来。 我来自Apach环境,所以这对我来说是相当新的。 我有以下文件夹结构: /var/www/mydomain.tld/ └── web ├── error ├── favicon.ico ├── my_application ├── index.html └── robots.txt web是mydomain.tld的www-root文件夹,我的应用程序位于/web/my_aplication/ 。 我想在www.my_domain.tld被调用时在/ my_application中为应用程序提供服务。 标准指令是由ISPConfig自动创build的,但我想我需要添加几行,但我不知道我做错了什么。 这里是相关的部分(我猜): server { listen 1.2.3.4:80; server_name my_domain.tld; root /var/www/mydomain.tld/web; ## force www – added this myself if ($http_host !~ "^www\.") { rewrite ^(.*)$ http://www.$http_host$request_uri redirect; } ## rewrite to /my_application/ and last if ($http_host […]
重新启动我的apache2服务器时收到以下错误消息: [Wed Oct 31 11:44:33 2012] [warn] VirtualHost 172.30.30.12:443 overlaps with VirtualHost 172.30.30.12:443, the first has precedence, perhaps you need a NameVirtualHost directive … waiting [Wed Oct 31 11:44:34 2012] [warn] VirtualHost 172.30.30.12:443 overlaps with VirtualHost 172.30.30.12:443, the first has precedence, perhaps you need a NameVirtualHost directive 我最近更改了我的VirtualHost文件,使其当前的内容如下所示: <VirtualHost *:80> ServerName www.mydomain.com ServerAlias mydomain.com ServerAdmin […]
我试图给一个现有的Rails应用程序加上一个子域的前缀,实际上我希望这个子域服务于同一个应用程序。 现在apache2通过“www.example.com”或“example.com”服务我的应用程序。 我调整了我的网站 – 可用的虚拟主机,希望允许“foo.example.com”或“www.foo.example.com”,但是这两个实例都遇到一个域未发现的错误。 这是我在/etc/apache2/sites-available/example.com目前的VirtualHost: <VirtualHost *:80> ServerName example.com ServerAlias foo.example.com *.example.com www.foo.example.com www.example.com DocumentRoot /home/user/my_app/public <Directory /home/user/my_app/public> AllowOverride all Options -MultiViews </Directory> </VirtualHost> 有任何想法吗? 请注意,我意识到我可能不需要一个通配符子域来做我想做的事情,我只是在最后的努力中join了这个。 编辑:实际的域名是virtualrobotgames.com与所需的子域名是roboteer.virtualrobotgames.com
我已经阅读了https-vhosts.conf文件中的Apache文档,经过几个小时处理这个问题,我自己就想出了这个问题。 情况如下: 我们有一个以.ws结尾的域名 显然你不能在conf文件中这样做。 你必须使用? 通配符,否则将无法工作。 *通配符也不起作用。 此外,在ServerAlias指令中,如果ServerAlias指令中的第一个条目不正确,则超过第一个条目的任何内容都将不起作用。 这是一个不起作用的例子。 请注意,anotherdomain.com和yetanotherdomain.com将失败,因为domain.wsconfiguration不正确: <VirtualHost *:80> DocumentRoot /opt/local/apache2/sites/ourdomain ServerName www.thedomain.ws ServerAlias thedomain.ws another domain.com yetanotherdomain.com <Directory /opt/local/apache2/sites/ourdomain> allow from all </Directory> </VirtualHost> 这是我们工作条目的一个例子: <VirtualHost *:80> DocumentRoot /opt/local/apache2/sites/ourdomain ServerName www.thedomain.ws? ServerAlias thedomain.ws? another domain.com yetanotherdomain.com <Directory /opt/local/apache2/sites/ourdomain> allow from all </Directory> </VirtualHost> 如果有这方面的文件,我当然没有看到它。
我的networking服务器正在运行Plesk,并为每个新站点创build一个vhost.conf文件,其中包含一些include_path和open_basedir设置: <Directory /var/www/vhosts/website.nl/httpdocs> php_admin_value open_basedir "/usr/share/pear:/var/www/vhosts/global.website.nl/httpdocs/global:/tmp:/var/www/vhosts/website.nl/httpdocs" php_value include_path "/usr/share/pear:/var/www/vhosts/global.website.nl/httpdocs/global" </Directory> 是否有可能添加另一个这个网站,并有include_path和open_basedir设置更改为像这样的子目录: <Directory /var/www/vhosts/website.nl/httpdocs/subdirectory> php_admin_value open_basedir "/usr/share/pear:/var/www/vhosts/global.website.nl/httpdocs/global2:/tmp:/var/www/vhosts/website.nl/httpdocs/subdirectory" php_value include_path "/usr/share/pear:/var/www/vhosts/global.website.nl/httpdocs/global2" </Directory>
如何configurationApache重写一个子域的http请求到正确目录的https请求? 例如,我有以下VirtualHostconfiguration: 不过,这会将http://redmine…us转换为https://redmine…us/redmine 。 另外,改变 RewriteRule ^(.*)$ https://%{HTTP_HOST}/redmine [R] RewriteRule ^(.*)$ https://%{HTTP_HOST} [R] 似乎只是将HTTP请求redirect到HTTP://…us ,这是当前默认的/var/www/index.html页面。 有什么build议么?
这开始让我疯狂,我相信它很容易修复,我只是失去了一些东西。 我在服务器上安装了ISPConfig 3,我正在调整一些apacheconfiguration文件来尝试获取以下设置: dbadmin.pixelfolio.co.uk – 显示phpmyadmin panel.pixelfolio.co.uk – 显示ISPConfig面板 www.pixelfolio.co.uk显示一个客户端文件夹 pixelfolio.co.uk显示与上面相同的客户端文件夹 我有一个DNSlogging指向所有这些相同的IP。 在我目前的设置中,一切都显示除了pixelfolio.co.uk(没有www),由于某种原因显示phpmyadmin目前的网页。 如果我注释掉phpmyadmin虚拟主机,它会显示ISPConfig面板! 我希望它显示与www.pixelfolio.co.uk相同的东西 阿帕奇/ conf.d / phpmyadmin.conf #Alias /phpmyadmin /usr/share/phpmyadmin <Directory /usr/share/phpmyadmin> Options FollowSymLinks DirectoryIndex index.php <IfModule mod_php5.c> AddType application/x-httpd-php .php php_flag magic_quotes_gpc Off php_flag track_vars On php_flag register_globals Off php_value include_path . </IfModule> </Directory> # Authorize for setup <Directory /usr/share/phpmyadmin/setup> <IfModule mod_authn_file.c> […]