我花了整整一天的时间试图find我的问题的答案,但我失败了,决定在这里发布我的问题。 所以我开发了一个Django应用程序,现在我在将它部署到apache(httpd)服务器时遇到了问题。 如果相关,我正在运行CentOS 7.2。 我一直在遵循这个教程为了做我想要的: https : //www.digitalocean.com/community/tutorials/how-to-serve-django-applications-with-apache-and-mod_wsgi-on-centos- 7 显然,我没有从头开始创build一个新的项目,因为我已经有了一个,只是调整它,以适应教程。 一旦我完成并重新启动httpd服务,当试图访问该网站时,我收到以下错误消息: Forbidden You don't have permission to access / on this server. 这不是防火墙的问题,因为当我删除django.conf(即恢复更改)显示默认的Apache网站。 我的django.conf文件如下所示: Alias /static /home/dudu/DjangoProject/mysite/static <Directory /home/dudu/DjangoProject/mysite/static> Require all granted </Directory> <Directory /home/dudu/DjangoProject/mysite> <Files wsgi.py> Require all granted </Files> </Directory> WSGIDaemonProcess DjangoProject python-path=/home/dudu/DjangoProject:/home/dudu/DjangoProject/DjangoProjectEnv/lib/python2.7/site-packages WSGIProcessGroup DjangoProject WSGIScriptAlias / /home/dudu/DjangoProject/mysite/wsgi.py 相关的文件夹结构: /home/dudu/ |–DjangoProject | |–manage.py […]
Apache 2.2与Windows 7上的SSL 我有以下代理传递configuration,这很好 <Location /myproject> RequestHeader add X-LocalHeader "Headers For the Win" ProxyPass http://localhost:8084/myproject ProxyPassReverse http://localhost:8084/myproject ProxyPassReverseCookiePath /myproject http://localhost:8084/myproject </Location> 现在,我想添加另一个configuration,我希望每次path以/ myproject / newux开始到本地文件夹。 我在前面和上面的位置指令后都尝试过,但是它不起作用(代理configuration先启动) Alias "/myproject/newux" "D:/apps/Apache2.2/htdocs/myproject/newux" <Directory "D:/apps/Apache2.2/htdocs/myproject/newux"> Options Indexes </Directory> 什么是正确的configuration?
所以我有一个Apache HTTPD服务器(v2.4.6)mod_ssl。 我使用代码在/etc/httpd/conf.d/ssl.conf中设置了基本身份validation: <LocationMatch "xxxx"> AuthType Basic AuthName "Restricted" AuthUserFile /usr/local/apache/passwd/password Require valid-user </LocationMatch> 但是当我在Chrome / Firefox / IE中浏览到我的网站时,我多次login对话框(如3-5)。 我的网页本身使用弹簧安全。 所以这可能是cookies互相冲突? 从一个旧的post我尝试了选项1,但无济于事。
我是centos 7.我有两个服务器运行Apache和docker。 docker在8080端口和阿帕奇在80.现在我必须将所有请求从dockerredirect到Apache主页像。 如果用户在浏览器中键入http:// my-ip:8080 / some-thing ,则应该将其redirect到http://my-ip/index.php 。
我在AIX 6.1上运行Apache 2.4.20作为反向代理,以便访问运行在后端服务器上的Oracle商务智能11.1.1.7.150120。 反向代理修改原始HTML代码导致HREF锚点设置错误的地方。 这会导致菜单出现故障(锚点不再位于桌面结构上)。 原始HTML代码(部分): <a id="selEditDashboard" class="NQWMenuItem NQWMenuItemWIconMixin" href="javascript:void(null)" onclick="EditPage('saw.dll?EditDashboard&PortalPath=%2fusers%2fweblogic%2f_portal&Page=page%201&Done=saw.dll%3fDashboard');return false;" > <table class="MenuItemTable" cellspacing="0" cellpadding="0"> <tr> <td class="MenuItemIconCell"> <img border="0" src="res/sk_FusionFX/catalog/edit_ena.png" alt="Dashboard bearbeiten"/> </td> <td class="MenuItemTextCell" colspan="2">Dashboard bearbeiten </td> </tr> </table> </a> HTML代码来自反向代理: <a id="selEditDashboard" class="NQWMenuItem NQWMenuItemWIconMixin" href="javascript:void(null)" onclick="EditPage('saw.dll?EditDashboard&PortalPath=%2fusers%2fweblogic%2f_portal&Page=page%201&Done=saw.dll%3fDashboard');return false;" > </a> <table class="MenuItemTable" cellspacing="0" cellpadding="0"> <tr> <td class="MenuItemIconCell"> <img border="0" src="res/sk_FusionFX/catalog/edit_ena.png" […]
我有一个使用mod_auth_form运行Apache / 2.4.6的网站。 但是,我需要支持特定path上的基本身份validation来支持传统应用程序。 使用下面的configuration,网站将始终默认为表单身份validation,并且不会提示进行基本身份validation/遗留。 <Location "/"> AuthType form AuthFormProvider ldap … </Location> <Location "/legacy"> AuthType basic AuthBasicProvider dbm … </Location> 有没有一种方法来configuration网站提示只在该目录中的基本身份validation没有这样做? <Location "/forms"> AuthType form AuthFormProvider ldap … </Location> <Location "/legacy"> AuthType basic AuthBasicProvider dbm … </Location> 上面的选项将需要对当前网站进行更改,我想根据需要授权。
所以,我试图在我的Centos 7 Cloud VPS中为phpMyAdmin创build一个虚拟主机,但是当我尝试查看它时,出现错误http 404,如果NameServer与hostnamectl set-hostname webserver.exampledomain.tld 这里是configuration文件: /etc/httpd/conf/httpd.conf中: # This is the main Apache HTTP server configuration file. It contains the # configuration directives that give the server its instructions. # See <URL:http://httpd.apache.org/docs/2.4/> for detailed information. # In particular, see # <URL:http://httpd.apache.org/docs/2.4/mod/directives.html> # for a discussion of each configuration directive. # # Do NOT […]
我刚刚在运行apache的CentOS 6服务器上设置了letsencrypt ,SSL全部正常。 我只是试图redirecthttp到https使用这个: Redirect permanent / https://example.com/ 但是,在去http://example.com/somepath的情况下,而不是获取https://example.com/somepath我得到https://example.comesomepath … 出于某种原因, /未被添加到我正在访问的path,我看不到我可以如何解决这个问题。 我的httpd.conf : NameVirtualHost *:80 <VirtualHost *:80> ServerName example.com ServerAlias example.com DocumentRoot /var/www/html/ # RedirectMatch permanent ^(.*)$ https://www.example.com$1 # tried using this too, no luck Redirect permanent / https://example.com/ </VirtualHost> 运行: Apache/2.2.15 (Unix)
我有以下编码的url https://example.com/external-image?url=http%3A%2F%2Fwww.thirdpartydomain.com%2FTWM%2FImages%2F1264%2F143242%2FFull%2F2201625016119496.jpg 我使用国防部重写parsing查询string,然后代理的url。 我这样做的原因是从其他第三方网站使用我自己的SSL安全的共享图像。 下面的代码包含非编码的查询参数,这些参数可以很好地工作。 示例url https://example.com/external-image?url=http://www.thirdpartydomain.com/TWM/Images/1264/143242/Full/2201625016119496.jpg 示例代码 RewriteCond %{QUERY_STRING} url=((?:https?:\/\/)?(?:[^@\n]+@)?(?:www\.)?([^:\/\n]+).*) [NC] RewriteRule ^.*/external-image$ %1 [P,NC,L,E=new_host:%2] <If "-T reqenv('new_host')"> RequestHeader set Host %{new_host}e </If> 我的目标是编码我的查询参数在浏览器中形成一个有效的url,然后解码查询参数之前,我代理的url。 任何人有任何想法来处理这个最好的方法?
我有几个应用程序在Tomcat服务器下。 所以我想为每个应用程序的子域。 因此,如果用户想要访问应用程序,必须将https://app1.domain.com …分别访问Tomcat应用程序domain.com/app1/,domain.com/app2/。 我成功地configuration了apache和通配符证书来使用SSL。 但是,当访问每个应用程序的子域时不会redirect。 刚刚得到一个ERR_TOO_MANY_REDIRECTS错误。 这里是ssl.conf文件: <VirtualHost 10.0.0.1:443> ServerAdmin [email protected] DocumentRoot "/var/www/html" ServerName www.domain.com ServerAlias domain.com ErrorLog logs/ssl_error.log DirectoryIndex index.html SSLEngine on SSLProtocol All +TLSv1.2 -SSLv2 -SSLv3 SSLCertificateFile /opt/certs/domain.com.crt SSLCertificateKeyFile /opt/certs/domain.com.key SSLCertificateChainFile /opt/certs/domain.com.intermediate.crt <Directory "/var/www/html"> Order allow,deny Allow from all </Directory> </VirtualHost> <VirtualHost 10.0.0.1:443> DocumentRoot "/var/www/html/app1" ServerName app1.domain.com UseCanonicalName Off DirectoryIndex index.html ProxyRequests […]