Forum Moderators: phranque

Problem accessing my local website - localhost

when I put my website on my HOME data partition

         

claudius

1:57 pm on Jan 24, 2026 (gmt 0)

Top Contributors Of The Month



Hello, everyone
First post on this forum.

Need help accessing my local website (localhost) on my computer:

Here is my ARCH installation:

Arch Linux OS: Linux 6.18.6-arch1-1
ARCH system partition: / (44Gb - 3.5Gb free)
Home data partition: /home (410Gb - 231 Gb free)
Workstation user: example


XAMPP installation :

Apache: Apache/2.4.66 (Unix)
PHP: 8.5.2
mariadb/12.1.2-1

I am trying to install my website directories and files in my HOME partition under the directory /home/example/www/.
The permissions for this directory and subdirectories /home/example/www/ = drwxr-xr-x (755).

When I start the httpd.service service

$ sudo systemctl restart httpd.service


I get this message:

Job for httpd.service failed because the control process exited with error code.
See systemctl status httpd.service and journalctl -xeu httpd.service for details.


and with

$ journalctl -xeu httpd.service"


I get this:


[he unit httpd.service has started to start.
Jan 23 15:49:46 LenovoE560 httpd[87780]: AH00526: Syntax error on line 284 of /etc/httpd/conf/httpd.conf:
Jan 23 15:49:46 LenovoE560 httpd[87780]: DocumentRoot /home/example/www is not a directory, or is not readable
Jan 23 15:49:46 LenovoE560 systemd: httpd.service: Main process exited, code=exited, status=1/FAILURE


How can I create/modify a website in the /home/example/www/ directory located on my Home data partition: /home

Here are some HTTP server directives:

File /etc/httpd/conf/httpd.conf


AllowOverride none
Require all granted

ServerRoot /etc/httpd

DocumentRoot /home/example/www

User example
Group example


File /etc/php/php.ini

 open_based ir = /etc/httpd/:/home/example/www


May be, I have to set some other directives?


[1][edited by: not2easy at 2:30 pm (utc) on Jan 24, 2026]
[edit reason] Please see Charter [webmasterworld.com] [/edit]

not2easy

2:37 pm on Jan 24, 2026 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Hello claudius and welcome to WebmasterWorld [webmasterworld.com]

For security and privacy reasons we use "example" to replace any PII in discussions, I apologize for the edits here.

I have only used MAMP for local testing so I'm not so familiar with your setup. Others have the experience to assist.

For your benefit, that welcome link above offers tips on using the forums' features and settings.

lucy24

5:27 pm on Jan 24, 2026 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Jan 23 15:49:46 LenovoE560 httpd[87780]: AH00526: Syntax error on line 284 of /etc/httpd/conf/httpd.conf: 
Don't keep us in suspense. What does line 284 of /etc/httpd/conf/httpd.conf say? Have you edited httpd.conf in any way, or are you using the boilerplate config file that came with xampp?

You have been unlucky in your responses. I too only know MAMP.

graeme_p

11:40 am on Jan 25, 2026 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



This is not a XAMPP problem, its an Apache config file option. If you share the lines around 284 (with domain names redacted etc.) we can probably help.

I would generally not use XAMPP on Linux. Its easy to install the LAMP stack from repositories (especially if you can install Arch and other software on Arch), the versions from the repos are less likely to have compatibility issues are are better tested, and it is better documented. In the case of Arch, the wiki and forums are very good.

claudius

3:49 pm on Jan 25, 2026 (gmt 0)

Top Contributors Of The Month



Here the lines around 284


DocumentRoot "/usr/share/webapps"
<Directory "/usr/share/webapps">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# [httpd.apache.org...]
# for more information.
#
Options Indexes FollowSymLinks

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride None

#
# Controls who can get stuff from this server.
#
Require all granted
</Directory>


When i set <Directory "//home/example/www"> in the httpd.cong and set open basedir = /etc/httpd/:/usr/share/webapps/:/home/example/www/:/tmp/ in thephp.ini nothings works

However LAMP is present on my computer and is running when i start it, but probably not configured. I will try to configure it and return to you with that.

[example@LenovoE560 ~]$ pacman -Qs lamp
local/xampp 8.2.12-1
A stand-alone LAMPP distribution


[edited by: not2easy at 4:49 pm (utc) on Jan 25, 2026]
[edit reason] Please see Charter [webmasterworld.com] [/edit]

graeme_p

4:15 pm on Jan 25, 2026 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



That is XAMPP. It looks like you have installed it from an AUR package: [aur.archlinux.org...] My suggestion is that it is generally better to separately install Apache, maria DB, PHP and anything else you need from XAMPP from the offical Arch repositories. How to do this is well documented in lots of places. I do not think that would help with this particular problem - just a good idea in general.

Why do you have two slashes in this?

<Directory "//home/example/www">


Does Apache work without that config change? i.e. the config you actually pasted here works but it breaks when you edit that? Is the above line 284?

[edited by: not2easy at 4:50 pm (utc) on Jan 25, 2026]
[edit reason] exemplified [/edit]

lucy24

5:51 pm on Jan 25, 2026 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



:: quick detour to MAMP config to get a sense of what's what ::

OP says
/home/example/www/
while the quoted bit of config says
/usr/share/webapps

Shouldn't these two be the same? I've got
DocumentRoot "/Users/myname/full-filepath-here/example"
and
<Directory "/Users/myname/full-filepath-here/example">

(In fact I have four sets of them, for four* different sites living on the same HD, but one thing at a time.)

* There should be five, but I never got around to adding my second test site. It involves editing the computer's Hosts file in Terminal, which terrifies me every time.

claudius

12:33 am on Jan 26, 2026 (gmt 0)

Top Contributors Of The Month



graeme_p : <Directory "//home/example/www"> is a mistake of my own. the real apache directive is <Directory "/home/example/www">....</Directory>. Sorry for that mistake

[edited by: not2easy at 2:30 am (utc) on Jan 26, 2026]
[edit reason] Please see TOS [webmasterworld.com] [/edit]

claudius

1:56 am on Jan 26, 2026 (gmt 0)

Top Contributors Of The Month



To precised my problem, here how i set the directives Apache and PHP when i want put my site in my data partition specifiquely on "/home/example/www"
For Apache in config file : /etc/httpd/conf/httpd.conf i have that :

#
#
ServerRoot "/etc/httpd"
#
#
<IfModule unixd_module>
User http
Group http
</IfModule>
#
#
<Directory />
AllowOverride none
Require all granted
</Directory>
#
#
DocumentRoot "/home/example/www"
<Directory "/home/example/www">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
#
#
<IfModule dir_module>
DirectoryIndex index.php index.html
</IfModule>
#
#


For PHP in config file /ect/php/php.ini i have that :

open basedir = /etc/httpd/:/usr/share/webapps/:/home/example/www/:/tmp/


When i start Apache service with :
[example@LenovoE560 ~]$ sudo systemctl restart httpd.service

The journal see me this error :
L'unité (unit) httpd.service a commencé à démarrer.
jan 25 20:21:18 LenovoE560 httpd[10820]: AH00526: Syntax error on line 267 of /etc/httpd/conf/httpd.conf:
jan 25 20:21:18 LenovoE560 httpd[10820]: DocumentRoot '/home/example/www' is not a directory, or is not readable
jan 25 20:21:18 LenovoE560 systemd: httpd.service: Main process exited, code=exited, status=1/FAILURE
Subject: Unit process exited

The proprietor for /home/example/www is me (example) and the group authorized for this repertory is also example.
When i change User http and Group http in the apache file config for User example and Group example I obtain the same mistake.
Thanks to say me if you find with all this a solution to my problem.
For the follow, I will try to re-install Apache, PHP and MariaDB as you suggest to me.

[1][edited by: not2easy at 2:29 am (utc) on Jan 26, 2026]
[edit reason] Please see TOS [webmasterworld.com] [/edit]

lucy24

4:33 am on Jan 26, 2026 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



/:/

? Really?

claudius

9:42 pm on Jan 27, 2026 (gmt 0)

Top Contributors Of The Month



I finally solved my problem - accessing my local website (localhost) when I place my websites in my HOME data partition.
After re-installing Apache / PHP / MariaDB the problem was again there. But I found the solution on the ArcLinux Forum

It is a system issue with the httpd.service.d service in the file: /etc/systemd/system/httpd.service.d/hardening.conf.

The ProtectHome=on directive was replaced with ProtectHome=no. in this file.

When I restart the deamond
sudo systemctl daemon-reload

and restart httpd.service the repertory on my Home partition and defined in the DocumentRoot directive in the configuration of httpd become accessible

Martin Potter

2:34 am on Jan 28, 2026 (gmt 0)

5+ Year Member Top Contributors Of The Month



Wow! Success at last! Good work and, to me at least, inspirational!
Thanks.

graeme_p

1:52 pm on Jan 28, 2026 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Arch forums and wiki are great. The wiki is a useful resource even if you do not use Arch.

tangor

7:38 am on Jan 30, 2026 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Amazing what difference the position of two letters can make!

on
no