Sunday, April 3, 2022

[SOLVED] Apache Change Default User

Issue

I wish to run apache under a user named app_user. To achieve this I changed the following in the httpd.conf file

User app_user
Group app_user

app_user is a valid user and a group on this server.

The app_user has correct privileges to write in /var/log/httpd directory.

Now when i start apache it gives me this error.

[app_user@localhost conf]$ service httpd start
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName
(13)Permission denied: make_sock: could not bind to address [::]:80
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
                                                           [FAILED]

Appreciate some help on this.


Solution

Only 'root' user can bind connections to ports lesser than 1024. For more information here. Either configure the apache to use different port number which is higher than 1024 or sudo as root user. Later option is not recommended.



Answered By - kkravikumar
Answer Checked By - Gilberto Lyons (WPSolving Admin)