Help with conf files for xampp

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

Help with conf files for xampp

Postby ozstar » 10. March 2020 06:43

Hi,
I initially had Apache2 installed and working with my static IP # available from the net but as I was having trouble getting php going with it, I decided I would go with Xampp as it had all components I needed.

In the orig Apache2 install I had the .conf files for all my websites and they all worked. eg..
In etc/Apache2/ I created these folders...
conf-available
conf-enabled
sites-avaialble
sites-enabled
mods-available
mods-enabled


I have copied all the html folders with their websites in them from
var/www/html to opt/lampp/htdocs

but am not sure how to get the websites seen.

I guess it is something to do with the hosts and conf files.

http://localhost/dashboard/ shows me the correct Apache 2 page but when I enter localhost/websiteone
I get the index page with the directories listed not the actual html page and images as I did in the first Apache2 install not xampp.

Any help please?

oz
ozstar
 
Posts: 17
Joined: 04. September 2007 05:59

Re: Help with conf files for xampp

Postby ozstar » 10. March 2020 09:48

I have just seen this tutorial and want to be sure it is what I need to get my websites on line. I tried it but it does not work for me.

For a start the address to the httpd-vhosts.conf in my xampp setup is not xampp/apache/conf/extra.

My xampp Linux setup to that file is..opt/lamp/etc/httpd-vhosts.conf

Step 2. Create a virtual host under Apache web server

Navigate to the folder C:/xampp/apache/conf/extra.
Open the file httpd-vhosts.conf in a text editor. At the bottom of this file insert the below lines of code/directives.

ServerName xyz.com
ServerAlias www.xyz.com
DocumentRoot "c:/xampp/htdocs/xyz.com/public_html"

Now restart Apache, i.e. Stop and Start.

Note that you can have multiple entries of the above lines of code, one for each website that you add under your XAMPP.


I do have a path opt/lampp/apache2/conf/ with a httpd.conf file in it but which one is the one I need to use?

Thanks in anticipation of some direction.
ozstar
 
Posts: 17
Joined: 04. September 2007 05:59

Re: Help with conf files for xampp

Postby Nobbie » 10. March 2020 10:54

The Xampp Apache configuration files are stored in /opt/lampp/etc (httpd.conf) and /opt/lampp/etc/extra (httpd-vhosts.conf etc.)
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: Help with conf files for xampp

Postby ozstar » 10. March 2020 11:45

Thank you.

Where do I put the conf files for each site ?

In which file or folder ?
ozstar
 
Posts: 17
Joined: 04. September 2007 05:59

Re: Help with conf files for xampp

Postby Nobbie » 10. March 2020 13:19

Xampp does not have that concept of different conf files for different sites/domains. That is Debian (and OpenSUSE) way of configuration. You have to put all VirtualHosts into httpd-vhosts.conf for Xampp. You cannot simply copy the previous (Debian?) configuration to Xampp. You should edit httpd-vhosts.conf and insert all changes you need.
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: Help with conf files for xampp

Postby ozstar » 10. March 2020 20:15

Thanks, that's what I needed. Great !
ozstar
 
Posts: 17
Joined: 04. September 2007 05:59

Re: Help with conf files for xampp

Postby ozstar » 12. March 2020 23:51

Well finally did that in the httpd-vhosts.conf /opt/lampp/etc/extra like so...

<VirtualHost *:80>
ServerAdmin webmaster@sydneybiz.com
DocumentRoot "/opt/lampp/htdocs/myownofficeserver/"
ServerName myownofficeserver.com
ServerAlias http://www.myownofficeserver.com
ErrorLog "logs/myownofficeserver-error_log"
CustomLog "logs/myownofficeserver-access_log" common
</VirtualHost>


but do I need to enter anything in the httpd.conf file in /opt/lampp/etc
This is the default..

Alias /bitnami/ "/opt/lampp/apache2/htdocs/"
Alias /bitnami "/opt/lampp/apache2/htdocs"

<Directory "/opt/lampp/apache2/htdocs">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>


When i enter the domain name outside of the LAN I still get to the Apache/Dashboard page, not the index of my dom.

Is it because of anything above, or could it be something else. I have checked everything I know how to do.

Thank you for your help.
ozstar
 
Posts: 17
Joined: 04. September 2007 05:59

Re: Help with conf files for xampp

Postby ozstar » 21. March 2020 00:24

Hi,

Can anyone tell me if I need to change the default httpd.conf that comes with Linux Xampp?

/opt/lampp/etc/httpd.conf


Alias /bitnami/ "/opt/lampp/apache2/htdocs/"
Alias /bitnami "/opt/lampp/apache2/htdocs"

<Directory "/opt/lampp/apache2/htdocs">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>


My web html file are here..
opt/lampp/htdocs/
ozstar
 
Posts: 17
Joined: 04. September 2007 05:59

Re: Help with conf files for xampp

Postby Nobbie » 21. March 2020 10:59

No, you dont.

But probably your Virtualhost does not work and is ignored by Apache due to a wrong ServerAlias. You cannot apply a protocoll like http: in the ServerName or ServerAlias, that is quite nonsense. Delete the line with the bad ServerAlias, reboot Apache, evt. clear the browser cache and finally try again.

A quick look into the error log would tell you about your error.
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: Help with conf files for xampp

Postby ozstar » 22. March 2020 00:58

Thank you Nobbie. I have decided to uninstall Xampp due to the many who say it is not secure even though it it is deliciously easy to install all 3 components.
I only got into it because I had so much trouble getting mySQL and php installed with the regular Apache 2.
The Apache works fine but I will have to try again for the other two.

BTW I did look at the xampp error log and this is what was in it for the last 2 days.

Code: Select all
[Sat Mar 21 07:29:27.899361 2020]
[authz_core:error]
[pid 22172]
[client 144.76.14.153:46134]
AH01630: client denied by server configuration: /opt/lampp/phpmyadmin/

[Sat Mar 21 10:04:07.267512 2020]
[php7:error]
[pid 14750]
[client 46.119.174.102:58607]
script '/opt/lampp/htdocs/dashboard/xmlrpc.php' not found or unable to stat

[Sat Mar 21 10:51:38.522682 2020]
[cgi:error]
[pid 17519]
[client 180.116.198.194:47143]
AH02811:
script not found or unable to stat: /opt/lampp/htdocs/setup.cgi

[Sat Mar 21 16:22:43.645469 2020]
[cgi:error]
[pid 14750]
[client 194.180.224.249:37554]
AH02811: script not found or unable to stat: /opt/lampp/cgi-bin/php5

[Sat Mar 21 18:07:35.616106 2020]
[authz_core:error]
[pid 14749]
[client 109.102.111.63:53408]
AH01630:
client denied by server configuration: /opt/lampp/phpmyadmin/,
referer: http://www.therootsofaussierockshow.com/dashboard/

[Sat Mar 21 21:41:30.096357 2020]
[cgi:error]
[pid 17519]
[client 194.180.224.249:58658]
AH02811:
script not found or unable to stat: /opt/lampp/cgi-bin/php

-----------------------------

[Sun Mar 22 01:03:02.883543 2020]
[php7:error]
[pid 14750]
[client 39.104.156.79:62606]
script '/opt/lampp/htdocs/router.php'
not found or unable to stat

[Sun Mar 22 04:44:58.427102 2020]
[php7:error] [
pid 17519]
[client 134.209.239.115:53852]
script '/opt/lampp/htdocs/wp-login.php' not found or unable to stat

[Sun Mar 22 05:01:27.780277 2020]
[php7:error]
[pid 17524]
[client 193.29.15.107:41592]
script '/opt/lampp/htdocs/login.php'
not found or unable to stat

[Sun Mar 22 05:35:12.121502 2020]
[php7:error]
[pid 16146]
[client 54.38.234.209:51110]
script '/opt/lampp/htdocs/wp-login.php'
not found or unable to stat

[Sun Mar 22 05:59:29.905922 2020]
[php7:error]
[pid 21210]
[client 138.68.80.235:46024]
script '/opt/lampp/htdocs/wp-login.php'
not found or unable to stat

[Sun Mar 22 06:25:47.737550 2020]
[cgi:error]
[pid 14752]
[client 194.180.224.249:52992]
AH02811:
script not found or unable to stat: /opt/lampp/cgi-bin/php4

[Sun Mar 22 07:31:23.688302 2020]
[php7:error]
[pid 14751]
[client 76.126.50.66:56926]
script '/opt/lampp/htdocs/404.php'
not found or unable to stat
ozstar
 
Posts: 17
Joined: 04. September 2007 05:59

Re: Help with conf files for xampp

Postby Nobbie » 22. March 2020 11:33

Apache only checks once the VirtualHosts, while booting. Actually i dont know to which error log an invalid VirtualHost is reported. But there is a commandline option "-S" for Apache, which lets Apache check and report about the VirtualHosts.

If you have trouble to get the Servers and Php running on your linux, why dont you simply install a server distribution. Like Ubuntu Server for example. These are fully configured out of the box.
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 22 guests