Where to Discuss?

Local Group


Goal: Setting-up LAMP stack with Artix OpenRC. Configure the Apache + PHP tier.

Install Apache Packages

Just like any other service in OpenRC, we need both packages, and the init package.

  • apache
  • apache-openrc
❯ sudo pacman -S apache apache-openrc
warning: apache-2.4.56-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (2) apache-2.4.56-1

Total Installed Size:  6.47 MiB
Net Upgrade Size:      0.01 MiB

:: Proceed with installation? [Y/n] y
(2/2) checking keys in keyring                    
(2/2) checking package integrity                  
(2/2) loading package files                       
(2/2) checking for file conflicts                 
(2/2) checking available disk space               

LAMP OpenRC: Apache: Install Apache Packages

As usual, pay attention to the message below:

:: Processing package changes...
(1/2) reinstalling apache                         
(2/2) installing apache-openrc                    
:: Running post-transaction hooks...
(1/2) Creating temporary files...
(2/2) Displaying openrc service help ...
	==> Add a service to runlevel:
	rc-update add <service> <runlevel>
	==> Start/stop/restart a service:
	rc-service <service> <start/stop/restart>

LAMP OpenRC: Apache: Install Apache Packages

Running Service

For OpenRC we have this two commands:

  • rc-update,
  • rc-service
❯ sudo rc-update add httpd default
 * service httpd added to runlevel default

LAMP OpenRC: Apache: Running Service

❯ sudo rc-service httpd status
 * status: stopped
❯ sudo rc-service httpd start
httpd             | * Starting httpd ...        [ ok ]
❯ sudo rc-service httpd status
 * status: crashed

LAMP OpenRC: Apache: Running Service

Woat? It crashed.


Strange, that it works, even though the init say it crashed. And I still don’t know why.

❯ curl http://localhost
  <title>Index of /</title>
<h1>Index of /</h1>
   <tr><th valign="top"><img src="/icons/blank.gif" alt="[ICO]"></th><th><a href="?C=N;O=D">Name</a></th><th><a href="?C=M;O=A">Last modified</a></th><th><a href="?C=S;O=A">Size</a></th><th><a href="?C=D;O=A">Description</a></th></tr>
   <tr><th colspan="5"><hr></th></tr>
   <tr><th colspan="5"><hr></th></tr>

LAMP OpenRC: Apache: CURL localhost

You can also pipe the output to vim as curl http://localhost | vim -R -.

Configure HTTPD

You might have a situation where you find this server’s fully qualified domain name error.

❯ sudo rc-service httpd start
httpd             | * Caching service dependencies ...                                                  [ ok ]
httpd             | * Starting httpd ...
httpd             |AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using Set the 'ServerName' directive globally to suppress this message
httpd             |httpd (pid 5849) already running 

We just need to add Servername in confgiuration.

# epsi!
ServerName localhost

LAMP OpenRC: Apache: Configure HTTPD


How I would I know that Apache works in localhost?

Consider have a look at how the web server response goes in browser.

LAMP OpenRC: Apache: Browser

This web server works well.

What is Next 🤔?

We can contiune our tier to PHP.

Consider continue reading [ LAMP - PHP Setup ].

Thank you for reading.