Ask Your Question

Trying to setup LAMP -> httpd.conf issues -> file editing issues

asked 2017-06-13 10:31:28 -0500

adminofnothing gravatar image

Hello all,

Whilst trying to get LAMP stack up and running for this new Fedora 25 workstation, I am running into a few stumbling blocks.

First and foremost, I am following instructions on getting LAMP up and running per this page:

I have gotten to the step where I am supposed to check the Apache server status with the command sudo systemctl status httpd.service

However, I receive the following error message:

localhost.localdomain httpd[3326]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the 'ServerName' directive globally ti disable this message

Using the power of search-engine problem solving, I came upon a simple solution: I merely have to edit my /etc/httpd/conf/http.conf file to say ServerName localhost

However, using vi to edit the file as a root user, the file does not change. Invariably, re-opening the file reveals that it still says #ServerName

I have tried using graphical editors to open the file as well, but I am met with the error message:

Unable to init server: Could not connect: Connection refused <br> Gtk-WARNING **: cannot open display:

I hear, from the internet grapevine, that the solution is to add export: DISPLAY=0; to some file, though I'm not clear what that file is. However, I imagine it may be difficult to edit said file, given that my only means of editing is vi, which is proving fruitless to my nonexistent linux skill-level.

So.. how do I fix this nested set of problems so that I can fix the primary problem for which I embarked on this journey of nested troubleshooting in the first place?

edit retag flag offensive close merge delete



Given that you mention you are a Linux newbie, I'd hazard a guess here. VIM works differently to editors we come across in the Windows world .. it has a concept of a command mode, editing mode etc.You might be opening the file in vim for editing but missing out that you need to switch to editing mode. Check out a few video tutorials on vim basics - here is one on YouTube

In short -

Open file vim /etc/httpd/conf/http.conf

Move cursor to where you want to edit. Press the i key on the keyboard.

To finish editing ESC > :wq ENTER

JetStream gravatar imageJetStream ( 2017-06-13 14:26:01 -0500 )edit

Some people prefer to use nano as editor instead of vi or emacs; for obvious reasons.

sudo dnf install nano
villykruse gravatar imagevillykruse ( 2017-06-14 07:10:12 -0500 )edit

2 Answers

Sort by » oldest newest most voted

answered 2017-06-14 15:44:14 -0500

capt gravatar image

Install sudo dnf install nano sudo nano /etc/httpd/conf/http.conf

edit flag offensive delete link more


Ctrl+X to exit, Ctrl+W to search. It will prompt you to save on exit.

Aeyoun gravatar imageAeyoun ( 2017-06-15 19:54:55 -0500 )edit

answered 2017-06-14 14:45:44 -0500

MAHESH gravatar image

You Are Here: Home → Linux → How To's → Fedora → install LAMP on Fedora How to install LAMP on Fedora 22 By: Raj Last Updated: January 16, 2016 1 Comment apache, fedora 22, mysql, php

LAMP Stands for Linux,Apache,MySQL and PHP. Most of the websites works with the above combination.Below are the steps to install LAMP on Fedora 22. Installing Linux:

Here i am not going to show how to install Fedora 22. The main purpose of this post is to setup AMP (Apache,MySQL and PHP) only.

Installing Apache:

To start off we will install Apache. Open up the terminal and switch to root.

$ su

Name of the package is httpd, type following command on the terminal and then press enter.

dnf install httpd

Start the Apache by using the following command.

systemctl start httpd.service

Enable apache to start during the every boot, type the following on terminal and hit Enter.

systemctl enable httpd.service

Configure firewall to allow http request from the external network. Here we will be using static firewall rules, so will disable firewalld and enable iptables and ip6tables.

yum install iptables-services

systemctl mask firewalld.service

systemctl enable iptables.service

systemctl enable ip6tables.service

Start both iptables and ip6tables.

systemctl stop firewalld.service

systemctl start iptables.service

systemctl start ip6tables.service

Allow apache through firewall, we will allow both http and https traffic.

iptables -I INPUT -m state --state NEW -p tcp --dport 80 -j ACCEPT

iptables -I INPUT -m state --state NEW -p tcp --dport 443 -j ACCEPT

service iptables save

Testing Apache:

To make sure everything installed correctly we will now test Apache to ensure it is working properly.

Open up any web browser and then enter the following into the web address:

http://localhost/ or

You will get the web page saying “Fedora Test Page”. Now the Apache is working fine. Apache’s default document root is /var/www/html on Fedora, and the configuration file is /etc/httpd/conf/httpd.conf. Additional configurations are stored in the /etc/httpd/conf.d/ directory.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2017-06-13 10:31:28 -0500

Seen: 335 times

Last updated: Jun 13 '17