Upgrade 13.1->13.2 and virtual host dont work php change?

I upgraded to 13.2 and all else works but virtualhosts. I run a separate .conf file included in /conf.d. Worked ok in 13.1. now I just get 403 error when connecting. One alias page goes thru online so apache running in someway.

I tried to check all modules if missing any, but they all seem to be ok. I guess.

I am kinda stuck. How to solve this?



# get the server name from the Host: header
UseCanonicalName Off
ServerSignature Off
ServerTokens Min
HostnameLookups On



RewriteEngine On
# include the server name in the filenames used to satisfy requests
VirtualDocumentRoot /srv/www/htdocs/virtualhosts/%0
VirtualScriptAlias  /srv/www/htdocs/virtualhosts/%0/cgi-bin/

<Directory "/srv/www/htdocs/virtualhosts/www.****/data">
AuthUserFile /srv/www/.htpwadmin
AuthGroupFile /dev/null
AuthName Private
AuthType Basic 
require user ****
</Directory>

# ONLY ONE THAT WORKS!
<Directory "/srv/www/htdocs/virtualhosts/files.******.**">
AuthUserfile /srv/www/.files
AuthGroupfile /dev/null
AuthName Yksityinen
AuthType Basic
require user *****
</Directory>

RewriteEngine on
rewritecond %{HTTP_HOST} ^****.net 
rewriterule ^(.*)$ http://www.*****.fi/$1 [r=301,nc]




LanguagePriority en fi
Alias /errordocs /srv/www/htdocs/errordocs


<Directory /srv/www/htdocs/errordocs>
AllowOverride None
Options MultiViews IncludesNoExec FollowSymLinks
AddType text/html .shtml
<FilesMatch "\.shtml.$]">
SetOutputFilter INCLUDES
</FilesMatch>
</Directory>


## "404 Not Found", 
ErrorDocument 404 /errordocs/404 



Do you have htaccess files in any of the virtual hosts?

Or allow / deny options?

Nope. All open to web. I guess this “VirtualDocumentRoot /srv/www/htdocs/virtualhosts/%0” doesent work…Maybe apache not reading headers right? Or php issue as all virtual domains in php. But the error doesent seem to be as of php error.

The .conf posted file is the whole file and redirected ok 12 domains in 13.1.

Try setting loglevel to debug in /etc/sysconfig/apache2 and restart it.

Note; this will spam logs with logs of information but may allow you to pinpoint the issue. The default loglevel is warn.

I been trying all nite to figure out how to override the global filesystem denial set in httpd.conf. Didnt have this problem before. Tried in virtualhost.conf setttings to use


<Directory "/srv/www/htdocs/virtualhosts"> # also tried  "/srv/www/htdocs/virtualhosts/%0" and  "/srv/www/htdocs/virtualhosts/www.servername.com"
    Options Indexes FollowSymLinks Includes
    AllowOverride All
    Order allow,deny
    Allow from All 
</Directory>






RewriteEngine On
# include the server name in the filenames used to satisfy requests
VirtualDocumentRoot /srv/www/htdocs/virtualhosts/%0

and all kind variants of of above. Looks like cant override the global setting…Just that wouldnt wanna edit the httpd.conf. I guess only way to do it.

Have you tried using YAST to create your virtualhosts?

For instance, the following procedure

  • move your current .conf file so it remains preserved through the following changes.
  • Install the yast web server management applet, if it’s not yet installed
zypper in yast2-http-server
  • stop/restart your apache2 service (don’t know if it’s required, but a good test to verify the .conf file will auto regenerate)
systemctl restart apache2

If the above throws an error about the missing .conf file, then force re-install apache to regenerate is prob easiest

zypper in -f apache2
  • Open the YAST http server applet and configure your virtualhosts.
  • Open the newly modified .conf file(by YAST only) and if necessary add in any custom modifications from your own 13.1 .conf file although to my eye I didn’t notice anything immediately you wouldn’t have been able to configure in YAST.
  • Restart your apache2 service again if you made any changes and watch for any thrown errors (hopefully none).

The above attempts to just re-setup your virtualhosts configuration without trying to troubleshoot any existing problems. If you choose to troubleshoot instead, I’d ask whether you see any errors in your journal and/or your apache logs (especially after the suggestion to increase your logging level which I’d be somewhat surprised since if virtualhosts isn’t working that seems pretty major). In fact, I’d be surprised if you didn’t already have anything pretty specific and verbose reported in your apache logs if you scan for any existing 403 error entries.

HTH,
TSU

I didnt use yast as like to use “VirtualDocumentRoot” for virtual hosts. Dont need to separately add/remove in yast if change them. Just add a folder in main server path.

I think I just need to put a .htaccess file in root of every virtual host to bypass the global setting. Didnt try that yet though.

Typically, there can be many ways to implement something in computing.
But, to get max reliability and quickest solution to problems in a community you need to conform to the “well worn path” instead of implementing your own design.

So, my advice is to set up in a conventional way using the YAST applet. Once done, it will mean that both today and into the future you will have a setup others will be able to quickly compare and understand.
Although your current configuration will almost certainly work when you find the solution to your issues, it will always be a higher maintenance configuration.

This is something I advise in many aspects of computing,
TSU