LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 05-09-2019, 01:53 AM   #1
direktor
LQ Newbie
 
Registered: Apr 2019
Posts: 20

Rep: Reputation: Disabled
can't find httpd.conf


Hello,

I'm trying to configure domains to point to each respective folder on server. I heard this can be done by configuring virtual host file. But I can't find it on CentOS 6. Can someone tell me where it is please?

Regards, Bogomil
 
Old 05-09-2019, 02:07 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,168
Blog Entries: 1

Rep: Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038
Quote:
Originally Posted by direktor View Post
Hello,

I'm trying to configure domains to point to each respective folder on server. I heard this can be done by configuring virtual host file. But I can't find it on CentOS 6. Can someone tell me where it is please?

Regards, Bogomil
httpd.conf is under /etc/httpd/conf.
You may also look at /etc/httpd/conf.d/ for other configuration files

Regards
 
1 members found this post helpful.
Old 05-09-2019, 02:51 AM   #3
direktor
LQ Newbie
 
Registered: Apr 2019
Posts: 20

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by bathory View Post
httpd.conf is under /etc/httpd/conf.
You may also look at /etc/httpd/conf.d/ for other configuration files

Regards
There is nothing there. Inside httpd there is only Alias folder.
 
Old 05-09-2019, 03:15 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,168
Blog Entries: 1

Rep: Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038
Quote:
Originally Posted by direktor View Post
There is nothing there. Inside httpd there is only Alias folder.
How did you install apache?
If you used Centos default httpd package(s), everything related to apache should be under /etc/httpd
 
Old 05-09-2019, 08:13 AM   #5
direktor
LQ Newbie
 
Registered: Apr 2019
Posts: 20

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by bathory View Post
How did you install apache?
If you used Centos default httpd package(s), everything related to apache should be under /etc/httpd
Via Add/Remove Software
 
Old 05-09-2019, 08:57 AM   #6
dc.901
Senior Member
 
Registered: Aug 2018
Location: Atlanta, GA - USA
Distribution: CentOS/RHEL, openSuSE/SLES, Ubuntu
Posts: 1,005

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
Can you post output of:

Code:
sudo find / -name httpd.conf
rpm -qa | grep -i httpd
cat /etc/*release
sudo yum repolist
 
Old 05-09-2019, 10:01 AM   #7
direktor
LQ Newbie
 
Registered: Apr 2019
Posts: 20

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by dc.901 View Post
Can you post output of:

Code:
sudo find / -name httpd.conf
rpm -qa | grep -i httpd
cat /etc/*release
sudo yum repolist
There is no sudo command in CentOS 6, I tried to search for it by using grep command, it just hangs, searched indefinitely.
 
Old 05-09-2019, 10:10 AM   #8
dc.901
Senior Member
 
Registered: Aug 2018
Location: Atlanta, GA - USA
Distribution: CentOS/RHEL, openSuSE/SLES, Ubuntu
Posts: 1,005

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
Quote:
Originally Posted by direktor View Post
There is no sudo command in CentOS 6, I tried to search for it by using grep command, it just hangs, searched indefinitely.
So, you login as root to do all admin tasks? Or, perhaps ask the admin of the machine in question...
 
1 members found this post helpful.
Old 05-09-2019, 10:21 AM   #9
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,759

Rep: Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931
sudo is located in /usr/bin but not enabled by default. /usr/bin is also in a users path environment and sudo should of been installed by default.

You can run the posted commands successfully as a regular user or use su.


Here is a howto guide.
https://www.digitalocean.com/communi...ts-on-centos-6
 
Old 05-09-2019, 10:38 AM   #10
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Apache is the httpd package.

What does "rpm -qa httpd" show?

What does "yum list httpd" show installed?

If not installed you can use "yum install httpd" to install it.

P.S.
sudo certainly exists on RHEL and CentOS but unlike other distros it isn't the default way of running admin commands. One logs in as root and runs them. sudo's purpose is to grant access to other non-admins to run specified commands as root. One can setup sudo to switch users (e.g. "sudo su -" to become root) and there is a default sudoers file.
 
Old 05-09-2019, 11:35 AM   #11
direktor
LQ Newbie
 
Registered: Apr 2019
Posts: 20

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by MensaWater View Post
Apache is the httpd package.

What does "rpm -qa httpd" show?

What does "yum list httpd" show installed?

If not installed you can use "yum install httpd" to install it.

P.S.
sudo certainly exists on RHEL and CentOS but unlike other distros it isn't the default way of running admin commands. One logs in as root and runs them. sudo's purpose is to grant access to other non-admins to run specified commands as root. One can setup sudo to switch users (e.g. "sudo su -" to become root) and there is a default sudoers file.
Apache is installed. I'm the admin. Although new to Linux. Look, look, look.... sudo command really works! But on my last installation it didn't. I'm still learning this thing. dc.901 thanks a lot. Seems the httpd.conf is hidden in /usr/local/apache/conf folder. Should I edit it manually or through Centos Web Panel?
 
Old 05-09-2019, 11:57 AM   #12
direktor
LQ Newbie
 
Registered: Apr 2019
Posts: 20

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by direktor View Post
Apache is installed. I'm the admin. Although new to Linux. Look, look, look.... sudo command really works! But on my last installation it didn't. I'm still learning this thing. dc.901 thanks a lot. Seems the httpd.conf is hidden in /usr/local/apache/conf folder. Should I edit it manually or through Centos Web Panel?
Now I have problems creating a file in that folder. Ftp doesn't want to create a file.
If I set up domain in Centos web panel and define Path seems no effect. To point domain to right folder the only way is through changing the httpd.conf file. Now how do I enable write permissions in the folder on server? To create a test index.html file.
 
Old 05-09-2019, 01:45 PM   #13
direktor
LQ Newbie
 
Registered: Apr 2019
Posts: 20

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by direktor View Post
Now I have problems creating a file in that folder. Ftp doesn't want to create a file.
If I set up domain in Centos web panel and define Path seems no effect. To point domain to right folder the only way is through changing the httpd.conf file. Now how do I enable write permissions in the folder on server? To create a test index.html file.
Ftp permissions problem fixed. But can not solve the problem with right domain pointing. I'll create a new question.
 
Old 05-09-2019, 03:55 PM   #14
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Quote:
Originally Posted by direktor View Post
Apache is installed. I'm the admin. Although new to Linux. Look, look, look.... sudo command really works! But on my last installation it didn't. I'm still learning this thing. dc.901 thanks a lot. Seems the httpd.conf is hidden in /usr/local/apache/conf folder. Should I edit it manually or through Centos Web Panel?
Apache may be installed but apparently not using the CentOS repositories. /usr/local is where things go when you roll your own (e.g. download, configure and make). It is NOT the default location for the rpm provided by RHEL/CentOS. The usual location is /etc/httpd as posted by someone else.

I notice you didn't bother to answer the questions asked but rather want us to accept that you know what you're doing despite the fact you came here asking how to find a file.
 
Old 05-10-2019, 12:34 AM   #15
direktor
LQ Newbie
 
Registered: Apr 2019
Posts: 20

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by MensaWater View Post
Apache may be installed but apparently not using the CentOS repositories. /usr/local is where things go when you roll your own (e.g. download, configure and make). It is NOT the default location for the rpm provided by RHEL/CentOS. The usual location is /etc/httpd as posted by someone else.

I notice you didn't bother to answer the questions asked but rather want us to accept that you know what you're doing despite the fact you came here asking how to find a file.
As I come from Windows environment I like GUI and installed CentOS 6 with GNOME. Then I installed Apache via System/Add Remove Software. I installed Services GUI. Httpd service is up and running. After running that sudo find command, I found httpd.conf file in the /usr/local/apache/conf folder. Default folder /etc/httpd is empty! I installed CentOS Web Panel. Configured DNS, FTP, emails...

In my case I have localhost pointing to /home/bogomil/public_html folder. You can check 168.235.88.193 and domain waiguolaoshi.club for example. If you type waiguolaoshi.club/index.html it will show result. But waiguolaoshi.club will redirect to public_html localhost folder not to /home/bogomil/publich_html/waiguolaoshi folder.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
I overwrote /etc/httpd/conf/httpd.conf NotionCommotion Linux - Newbie 10 04-25-2014 11:58 AM
How to configure /etc/httpd/conf/httpd.conf file to run a html on web arunava.saha Red Hat 2 05-30-2012 03:28 AM
httpd: Syntax error on line 210 of /etc/httpd/conf/httpd.conf: Syntax error on line 6 iswarya Linux - Newbie 1 01-25-2012 01:28 PM
Starting httpd: httpd: Syntax error on line 209 of /etc/httpd/conf/httpd.conf: Syntax sethukpathi Linux - Networking 6 04-12-2008 11:26 AM
httpd chokes on ScriptAlias line in Apache httpd.conf lhoff Linux - Software 1 07-14-2003 10:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 04:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration