Multiple version of PHP on different Virtual Hosts

read the manual - apache is apache

https://man.archlinux.org/man/extra/apache/httpd.8.en

You can use the phpmyadmin section in the guide you just followed, as a - sort of - template on how to create a virtual host

This create localhost/alias, not alias.test

Error 403 on “localhost” and virtual hosts…

permissions… apache runs as user http by default and the folders must match that. Plus add yourself to the http group, so that you have access.

Yes, this is possible. It requires you to either purchase a certificate from a recognised provider or create a self-signed certificate yourself for localhost (or for each vhost), which you can then manage in-house.

The latter has the benefit of being more affordable in comparison; but, note there will likely not be an abundance of reliable tutorials available in the wild, and it will require serious research.

I’m reluctant to create a step-by-step guide for this, or for any of your requests; only because I feel you need to do the work yourself and not be spoon-fed the answers in a convenient ‘how-to’ guide. Do your own research and learn it; don’t just copy it. :slight_smile:

Cheers.

One small tip, though. You’ll probably want to add the following to /etc/hosts at some point:

127.0.0.1 site1.test
127.0.0.1 site2.test
127.0.0.1 site3.test
1 Like

Help to do it? :smiley:

I will slowly learn to use Linux better, for now I need to configure my work environment.

I want to stay on manjaro, rolling release is a delight.

Done…
But 403 error…

sudo chown --recursive http:http /home/$USER/www/
sudo chmod --recursive 664 /home/$USER/www/
# or probably 775 if you need to execute files.
sudo usermod --append --groups http $USER

relogin to apply the group.

I’m not surprised. You’ll need to have set up your hosts first. Comment those out for now and leave them as a placeholder for whatever you will be calling your named hosts.

Same error…

What does it say in the logs?

ls /var/log/httpd/

This (wabbot.test is my first virtual host):

access_log  error_log  wabbot.test-access_log  wabbot.test-error_log

Yes… that are the logs. Whats the content?

tail -f /var/log/httpd/wabbot.test-error_log
# or
tail -f /var/log/httpd/wabbot.test-access_log

Here you can watch it live.

error_log:

[Sat Sep 30 15:54:51.870347 2023] [core:error] [pid 11903] (13)Permission denied: [client 127.0.0.1:33628] AH00035: access to / denied (filesystem path '/home/domenico/www') because search permissions are missing on a component of the path, referer: http://wabbot.test/
[Sat Sep 30 15:54:51.925428 2023] [core:error] [pid 11903] (13)Permission denied: [client 127.0.0.1:33628] AH00035: access to /favicon.ico denied (filesystem path '/home/domenico/www') because search permissions are missing on a component of the path, referer: http://wabbot.test/
[Sat Sep 30 15:54:52.436434 2023] [core:error] [pid 11903] (13)Permission denied: [client 127.0.0.1:33628] AH00035: access to / denied (filesystem path '/home/domenico/www') because search permissions are missing on a component of the path, referer: http://wabbot.test/
[Sat Sep 30 15:54:52.492367 2023] [core:error] [pid 11903] (13)Permission denied: [client 127.0.0.1:33628] AH00035: access to /favicon.ico denied (filesystem path '/home/domenico/www') because search permissions are missing on a component of the path, referer: http://wabbot.test/
[Sat Sep 30 15:54:52.928668 2023] [core:error] [pid 11903] (13)Permission denied: [client 127.0.0.1:33628] AH00035: access to / denied (filesystem path '/home/domenico/www') because search permissions are missing on a component of the path, referer: http://wabbot.test/
[Sat Sep 30 15:54:52.980664 2023] [core:error] [pid 11903] (13)Permission denied: [client 127.0.0.1:33628] AH00035: access to /favicon.ico denied (filesystem path '/home/domenico/www') because search permissions are missing on a component of the path, referer: http://wabbot.test/
[Sat Sep 30 15:57:13.290563 2023] [core:error] [pid 11856] (13)Permission denied: [client 127.0.0.1:44678] AH00035: access to / denied (filesystem path '/home/domenico/www') because search permissions are missing on a component of the path, referer: http://wabbot.test/
[Sat Sep 30 15:57:13.347904 2023] [core:error] [pid 11856] (13)Permission denied: [client 127.0.0.1:44678] AH00035: access to /favicon.ico denied (filesystem path '/home/domenico/www') because search permissions are missing on a component of the path, referer: http://wabbot.test/
[Sat Sep 30 15:57:13.893830 2023] [core:error] [pid 11856] (13)Permission denied: [client 127.0.0.1:44678] AH00035: access to / denied (filesystem path '/home/domenico/www') because search permissions are missing on a component of the path, referer: http://wabbot.test/
[Sat Sep 30 15:57:13.946814 2023] [core:error] [pid 11856] (13)Permission denied: [client 127.0.0.1:44678] AH00035: access to /favicon.ico denied (filesystem path '/home/domenico/www') because search permissions are missing on a component of the path, referer: http://wabbot.test/

access_log:

127.0.0.1 - - [30/Sep/2023:15:54:52 +0200] "GET / HTTP/1.1" 403 1007
127.0.0.1 - - [30/Sep/2023:15:54:52 +0200] "GET /favicon.ico HTTP/1.1" 403 1023
127.0.0.1 - - [30/Sep/2023:15:54:52 +0200] "GET / HTTP/1.1" 403 1007
127.0.0.1 - - [30/Sep/2023:15:54:52 +0200] "GET /favicon.ico HTTP/1.1" 403 1023
127.0.0.1 - - [30/Sep/2023:15:55:42 +0200] "-" 408 -
127.0.0.1 - - [30/Sep/2023:15:57:13 +0200] "GET / HTTP/1.1" 403 1007
127.0.0.1 - - [30/Sep/2023:15:57:13 +0200] "GET /favicon.ico HTTP/1.1" 403 1023
127.0.0.1 - - [30/Sep/2023:15:57:13 +0200] "GET / HTTP/1.1" 403 1007
127.0.0.1 - - [30/Sep/2023:15:57:13 +0200] "GET /favicon.ico HTTP/1.1" 403 1023
127.0.0.1 - - [30/Sep/2023:15:58:06 +0200] "-" 408 -

But “www” folder is now locked, I wish I could write to it normally, chmod 777?

You really need to do some research on your own.

This forum is not intended for doing your work for you.

You claim

I think you wannabe - please do your own research …

Look at 775 …

Anyhow… if you have difficulties with that, then I really doubt that:

It is the bare minimum you should know… like knowing 3x3 is 9 and not 6. :smiley: Sorry…

3 times 3 equals … wait, what was the question?!

https://sx.nix.dk/search?q=why you should avoid chmod 777