httpd.conf

Can't access files in a subdirectory using Apache server

☆樱花仙子☆ 提交于 2019-12-05 16:53:05
I have an Apache 2.2.21 server installed on my Windows 7 machine. My site is up and my scripts from /scripts subdirectory are working but when I try to load icons from /icons I get a 403 forbidden error. I've already added this to my httpd.conf file: <Directory "c:/wamp/www/icons/"> Options Indexes FollowSymLinks Order Deny,Allow Deny from all Allow from 127.0.0.1 </Directory> Still no effect. So the question is: how can I access files in my /icons subfolder? P.S.: Using /images subdirectory worked out just fine but the question still remains. I figured out that /icons/ was included as an

How to access directory file outside django project?

只愿长相守 提交于 2019-12-05 16:45:55
I have my Django project running on RHEL 7 OS. The project is in path /root/project . And project is hosted on httpd server. Now iam trying to access a file out side the directory like /root/data/info/test.txt How should I access this path in views.py so that I can read and write file which is outside the project directory ? I tried to add the path in sys.path but it didn't work. Read and write permission are also give to the file. Add the following lines to your settings.py import os .. BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) FILES_DIR = os.path.abspath(os.path

Apache + Etags -> returns 200 and send content instead of 304

左心房为你撑大大i 提交于 2019-12-05 16:18:09
I have this Apache conf that uses Etags: <VirtualHost *:8080> ServerName xxx.co SSLEngine On SSLProtocol all -SSLv2 SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM SSLCertificateFile /etc/apache2/xxx.crt SSLCertificateKeyFile /etc/apache2/xxx.key SSLCertificateChainFile /etc/apache2/sub.class1.server.ca.pem SSLCACertificateFile /etc/apache2/ca.pem SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown ServerAdmin edward@xxx.co DocumentRoot /home/ubuntu/xxx-react/build/ Header set Access-Control-Allow-Origin "*" FileETag MTime Size </VirtualHost> I have this request

Turning RewriteEngine on creates 403 error--how to turn on FollowSymLinks?

风流意气都作罢 提交于 2019-12-05 15:34:24
I am working with the built-in Apache2 on OSX. I moved the document root to a folder on my desktop and made sure that _www and everyone have read access. It works fine and great, PHP works, everything works until I add a .htaccess with this line only: RewriteEngine on As soon as I do that, everything in the directory with the file is 403 Forbidden: Forbidden You don't have permission to access /dir/file.txt on this server. Apache logs show this error: [error] [client 127.0.0.1] Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden: /Users

Apache shutdown unexpectedly after documentroot change in httpd.conf

ぃ、小莉子 提交于 2019-12-05 09:08:25
I'm currently following this toturial to try to get use a folder in dropbox as my htdocs folder. When I change these lines: DocumentRoot "C:/xampp/htdocs" <Directory "C:/xampp/htdocs"> to DocumentRoot "C:/Users/Håvard/Dropbox/web" <Directory "C:/Users/Håvard/Dropbox/web"> I get the following error: 19:39:52 [Apache] Error: Apache shutdown unexpectedly. 19:39:52 [Apache] This may be due to a blocked port, missing dependencies, 19:39:52 [Apache] improper privileges, a crash, or a shutdown by another method. 19:39:52 [Apache] Press the Logs button to view error logs and check 19:39:52 [Apache]

Wamp Apache - Allow localhost

不羁岁月 提交于 2019-12-05 08:56:29
There are other questions similar to this but don't answer my problem. This is the default httpd.conf : <Directory "C:/wamp/www/"> Options Indexes FollowSymLinks AllowOverride all # onlineoffline tag - don't remove Order Deny,Allow Deny from all Allow from 127.0.0.1 </Directory> and it allows only 127.0.0.1 , but I want to allow also localhost and 192.168.x.x (my private ip). Well, the other answers are: put Allow from all and uncomment in hosts file the line 127.0.0.1 localhost ; but I read that is unsecure or not reccomended. So I've tried this: <Directory "C:/wamp/www/"> Options Indexes

Creating SubDomains to Absolute Paths with .htaccess

馋奶兔 提交于 2019-12-05 01:51:05
问题 Hey, My host is absolutely terrible. For some odd reason creating a subdomain in cPanel simply does not work, and their support lines are always busy. I thought I could get around this by using .htaccess. I'm sure it's not that hard, but I'm kind of new to mod_rewrite and have had little success searching in the last 5 hours. Heres the situation: /home/user/public_html automatically redirects to http://www.example.com Since I'm using a CMS in public_html it has already added the rule in

WAMP server not running after enabling httpd-vhosts.conf

本秂侑毒 提交于 2019-12-04 17:35:48
问题 I tried enabling Virtual Host on my WAMP installation, but WAMP server will not run if I enable http-vhosts.conf, and the icon remains orange. Here is my hosts file: 127.0.0.1 localhost 127.0.0.1 test.localhost My httpd.conf: # Virtual hosts Include conf/extra/httpd-vhosts.conf and my httpd-vhosts.conf: <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot "c:/wamp/www" ServerName localhost ErrorLog "logs/localhost-error.log" CustomLog "logs/localhost-access.log" common <

Apache on WampServer Keeps Crashing

本秂侑毒 提交于 2019-12-04 14:15:57
I run a medium traffic website that seems to be crashing all the time and I have to restart because it either doesn't load or cloudflare displays 520 error. Anyway I have searched up this error and they say to enable KeepAlive, but I haven't seen that option in the httpd.conf. My server info ( Yes I know linux is useful but I am using many windows softwares on my server computer as well ). I am running apache that is integrated with wamp server. 8GB of RAM and i7-2600, so it's a fast enough server. Fast enough Bandwidth as well. Here is the error log, let me know if you need any more info,

apache http rewrite/redirect based on ip

纵饮孤独 提交于 2019-12-04 13:52:43
I want to redirect an ip to another view of my website, for example, I want the visitor from ip x to see www.xxx.com?_DEBUG=1 while all other visitors see the normal www.xxx.com, how would I do this in apache config file, what directives are used? Here is an example of a rewrite configuration to do what you want - put this inside the virtual host for www.xxx.com on your server: RewriteCond %{REMOTE_ADDR} 1.2.3.4 RewriteCond %{QUERY_STRING} !_DEBUG=1 #RewriteRule ^/(.*)$ /$1?_DEBUG=1 [QSA,R,L] RewriteRule ^/(.*)$ /$1?_DEBUG=1 [QSA,L] A couple of notes: Change 1.2.3.4 to whatever IP you need The