LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Apache forcing HTTPS? (https://www.linuxquestions.org/questions/linux-newbie-8/apache-forcing-https-870811/)

jsp_1983 03-24-2011 05:25 PM

Apache forcing HTTPS?
 
I can find lots of help on how to force HTTPS with Apache, but I have a problem with the opposite - I want to stop it from forcing HTTPS.

I'm running Webmin/ Virtualmin on CentOS5. Some of my virtual hosts are accessible via http, some of them aren't. If I try them with https, however, they work fine. I can't see anything obvious in the httpd.conf file, so I'm just wondering how I can start to troubleshoot this problem? I tried deleting one of the virtual hosts via Virtualmin and implementing the account from scratch, but it makes no difference.

acid_kewpie 03-24-2011 05:34 PM

what does the virtual host config actually say in the httpd.conf? what does the error_log / access_log say?

jsp_1983 03-24-2011 06:13 PM

Quote:

Originally Posted by acid_kewpie (Post 4302232)
what does the virtual host config actually say in the httpd.conf? what does the error_log / access_log say?

Access_log just has GET requests from my IP address.

error_log says this:

Code:

[Thu Mar 24 14:56:38 2011] [error] [client 78.xx.xx.1] access to /var/www/html/phpmyadmin failed, reason: SSL connection required
[Thu Mar 24 14:59:15 2011] [error] [client 78.xx.xx.1] Directory index forbidden by Options directive: /home/holiday-ideas/public_html/
[Thu Mar 24 15:03:01 2011] [error] [client 207.241.236.47] File does not exist: /home/holiday-ideas/public_html/robots.txt
[Thu Mar 24 15:04:17 2011] [error] [client 78.xx.xx.1] Directory index forbidden by Options directive: /home/holiday-ideas/public_html/
[Thu Mar 24 15:15:16 2011] [error] [client 78.xx.xx.1] access to /var/www/html/phpmyadmin failed, reason: SSL connection required
[Thu Mar 24 15:15:20 2011] [error] [client 78.xx.xx.1] Directory index forbidden by Options directive: /home/holiday-ideas/public_html/
[Thu Mar 24 15:15:58 2011] [error] [client 78.xx.xx.1] Directory index forbidden by Options directive: /home/holiday-ideas/public_html/
[Thu Mar 24 15:16:05 2011] [error] [client 78.xx.xx.1] access to /var/www/html/phpmyadmin failed, reason: SSL connection required

And this is the virtual host section of my httpd.conf file:

Code:

<VirtualHost 178.238.130.240:80>
SuexecUserGroup "#500" "#500"
ServerName holiday-ideas.org.uk
ServerAlias www.holiday-ideas.org.uk
ServerAlias webmail.holiday-ideas.org.uk
ServerAlias admin.holiday-ideas.org.uk
DocumentRoot /home/holiday-ideas/public_html
ErrorLog /var/log/virtualmin/holiday-ideas.org.uk_error_log
CustomLog /var/log/virtualmin/holiday-ideas.org.uk_access_log combined
ScriptAlias /cgi-bin/ /home/holiday-ideas/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/holiday-ideas/public_html>
Options -Indexes +IncludesNOEXEC +FollowSymLinks +ExecCGI
allow from all
AllowOverride All
AddHandler fcgid-script .php
AddHandler fcgid-script .php5
FCGIWrapper /home/holiday-ideas/fcgi-bin/php5.fcgi .php
FCGIWrapper /home/holiday-ideas/fcgi-bin/php5.fcgi .php5
</Directory>
<Directory /home/holiday-ideas/cgi-bin>
allow from all
</Directory>
RewriteEngine on
RewriteCond %{HTTP_HOST} =webmail.holiday-ideas.org.uk
RewriteRule ^(.*) https://holiday-ideas.org.uk:20000/ [R]
RewriteCond %{HTTP_HOST} =admin.holiday-ideas.org.uk
RewriteRule ^(.*) https://holiday-ideas.org.uk:10000/ [R]
RemoveHandler .php
RemoveHandler .php5
IPCCommTimeout 31
</VirtualHost>


acid_kewpie 03-24-2011 06:20 PM

OK, so the error log is saying there's no index file and won't give you a listing. What are you expecting to happen when you do what? the errors I get hitting the main server name fit inline with the errors on the back end, obviously I've no idea what files actually do or don't exist though.

As for the redirections (and I'm not clear what the main issue is here TBH) then you have those redirects in place doing a redirect.... If you want them to work without https then you'd normally just have a suitable name based virtual host definition seperately from that one

jsp_1983 03-24-2011 06:42 PM

Okay, for example, if I hit /phpmyadmin, it gives me the "You don't have permission to access /phpmyadmin on this server." error.

If I just try a random, non-existent directory, like /xyz, I get the "The requested URL /xyz was not found on this server." error.

So I've just made an HTML file in the root, which I can now access. The problem that I thought was with Apache might be with PHPMyAdmin, which is what I was originally trying to access. I suspect there's something in the settings of PHPMyAdmin that I need to look at.

Thanks for helping, anyway.

jsp_1983 03-24-2011 07:33 PM

How strange... I changed the directory name from 'phpmyadmin' to 'dbadmin' and now I can access it.


All times are GMT -5. The time now is 12:37 PM.