Difficulties with the configuration of Virtual Hosts.

Problems with the Linux version of XAMPP, questions, comments, and anything related.

Difficulties with the configuration of Virtual Hosts.

Postby CryptoRiot » 01. December 2021 10:43

My system:

Operating System: Manjaro Linux
KDE Plasma Version: 5.23.3
KDE Frameworks Version: 5.88.0
Qt Version: 5.15.2
Kernel Version: 5.10.79-1-MANJARO (64-bit)

I have installed:

[2021-11-23] XAMPP for Linux 8.0.13-0
This version of XAMPP contains the following software releases:
- Apache 2.4.51
- MariaDB 10.4.22
- OpenSSL 1.1.1l
- PEAR 1.7.1
- PHP 8.0.13
- phpMyAdmin 5.1.1
- Update kernel and systemd for OS X VM (CVE-2021-33909 and CVE-2021-33910)

I used the instructions http://localhost/dashboard/docs/configure-vhosts.html

But further than to uncomment
Include etc / extra / httpd-vhosts.conf

in file
/opt/lampp/etc/httpd.conf

I have not advanced.
My task.
I started learning PHP and installed the NetBeans editor. And I want to open a project on my local server. For which I installed XAMPP.
NetBeans offers to save projects to its own directory
/ home / hgpd / NetBeansProjects /

And at first I tried to configure localhost for this directory, but it didn't work out for me.
Then, I created a folder
/ opt / lampp / docs / cryptoriot

gave the cryptoriot folder permissions 777. And saved the project there. The contents of the cryptoriot folder, this is another folder I have designated to store the NetBeans metadata and the index.php project file. I selected docs because my httpd-vhosts.conf file is written:
Code: Select all
 <VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot "/opt/lampp/docs/dummy-host.example.com"
    ServerName dummy-host.example.com
    ServerAlias www.dummy-host.example.com
    ErrorLog "logs/dummy-host.example.com-error_log"
    CustomLog "logs/dummy-host.example.com-access_log" common
</VirtualHost>
 
 <VirtualHost *:80>
    ServerAdmin webmaster@dummy-host2.example.com
    DocumentRoot "/opt/lampp/docs/dummy-host2.example.com"
    ServerName dummy-host2.example.com
    ErrorLog "logs/dummy-host2.example.com-error_log"
    CustomLog "logs/dummy-host2.example.com-access_log" common
</VirtualHost>

My problem is, I do not understand what exactly should be in the httpd-vhosts.conf files and in / etc / hosts.
The original hosts file is as follows:
Code: Select all
# Host addresses
127.0.0.1  localhost
127.0.1.1  hgpd-hpelitebook2170p
::1        localhost ip6-localhost ip6-loopback
ff02::1    ip6-allnodes
ff02::2    ip6-allrouters


I spent a day trying a bunch of variations. No result.
I also read the documentation at https://httpd.apache.org/docs/2.4/vhosts/examples.html, but for me it was like a sacred manuscript with spatial philosophical reasoning. And since I do not plan to become a server administrator in the near future, and for me, as a simple user, in such cases, it is better to contact those support of my hosting provider, then I want to ask the experts to just "poke a finger at me" - what exactly is in my the case should be written in the httpd-vhosts.conf and hosts files.

:mrgreen:
CryptoRiot
 
Posts: 2
Joined: 01. December 2021 10:31
XAMPP version: 8.0.13-0
Operating System: Manjaro

Re: Difficulties with the configuration of Virtual Hosts.

Postby Altrea » 01. December 2021 11:42

The directive ServerName needs to match one line in your /etc/hosts
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Difficulties with the configuration of Virtual Hosts.

Postby CryptoRiot » 01. December 2021 13:35

I know that. There should be
Code: Select all
127.0.0.1  localhost
127.0.1.1  hgpd-hpelitebook2170p
127.0.01 and something else
::1        localhost ip6-localhost ip6-loopback
ff02::1    ip6-allnodes
ff02::2    ip6-allrouters
CryptoRiot
 
Posts: 2
Joined: 01. December 2021 10:31
XAMPP version: 8.0.13-0
Operating System: Manjaro

Re: Difficulties with the configuration of Virtual Hosts.

Postby Altrea » 01. December 2021 14:03

then i have no clue what problems or questions you have
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Difficulties with the configuration of Virtual Hosts.

Postby Nobbie » 01. December 2021 14:22

CryptoRiot wrote:I know that. There should be
Code: Select all
127.0.0.1  localhost
127.0.1.1  hgpd-hpelitebook2170p
127.0.01 and something else
::1        localhost ip6-localhost ip6-loopback
ff02::1    ip6-allnodes
ff02::2    ip6-allrouters


I cannot see any ServerName of your VirtualHosts there.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: Difficulties with the configuration of Virtual Hosts.

Postby PatSer » 06. December 2021 05:51

Hello
As fare as I know, your /etc/hosts should contain something like:

Code: Select all
127.0.0.1  localhost
...
127.0.0.1 dummy-host.example.com dummy-host2.example.com
...

It did work for me.
PatSer
 
Posts: 1
Joined: 06. December 2021 05:42
XAMPP version: xampp-linux-x64-7.4.26-0
Operating System: OpenSuse Leap 15.2


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 39 guests