LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 06-14-2017, 01:24 PM   #1
hivtop
Member
 
Registered: Jan 2005
Location: In the Desert
Distribution: RedHat 9
Posts: 33

Rep: Reputation: 15
vhost-web server problem


Hello everyone.. it's been 4 years since I had to reinstall my server (due to a hard drive crash not hackers) and it seems I am WAYYY behind in the learning curve for fedora. LOL.. I went from fedora 12 to 21, apache 1.8 to 2.4.10 and bind 7 to 9.9 in a single leap.. and what a leap...

I have read tons of docs and tutorals, lost a lot of hair and reached the brain freeze point... hahaha So I'm asking for help...

My problem is... only my default site is coming up in any browser. none of my other sites 2, 3 or 4 show up or can be pinged.

apachectl -S or httpd -S both work fine, correct results without any errors after I took NameVirtualHost out of the conf files


box is:
Fedora 21
Apache 2.4.10
BIND 9.9

/etc/httpd/conf.d/vhost.conf

Code:
<VirtualHost *>
ServerName dns2.boxname.com
</VirtualHost>

<VirtualHost *:80>
ServerName site1.com
ServerAlias www.site1.com
ServerAlias webmail.site1.com
ServerAlias admin.site1.com
DocumentRoot /home/csc/public_html
ErrorLog /var/log/virtualmin/site1.com_error_log
CustomLog /var/log/virtualmin/site1.com_access_log combined
ScriptAlias /cgi-bin/ /home/csc/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/csc/public_html>
Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch 
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
AddType application/x-httpd-php5.6 .php5.6
AddType application/x-httpd-php .php
</Directory>
<Directory /home/csc/cgi-bin>
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
</Directory>
</VirtualHost>

<VirtualHost *:80>
ServerName site2.com
ServerAlias www.site2.com
ServerAlias webmail.site2.com
ServerAlias admin.site2.com
DocumentRoot /home/akahw/public_html
ErrorLog /var/log/virtualmin/site2.com_error_log
CustomLog /var/log/virtualmin/site2.com_access_log combined
ScriptAlias /cgi-bin/ /home/akahw/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/akahw/public_html>
Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch 
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
AddType application/x-httpd-php5.6 .php5.6
AddType application/x-httpd-php .php
</Directory>
<Directory /home/akahw/cgi-bin>
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
</Directory>
</VirtualHost>

<VirtualHost *:80>
ServerName site3.com
ServerAlias www.site3.com
ServerAlias webmail.site3.com
ServerAlias admin.site3.com
DocumentRoot /home/tcc/public_html
ErrorLog /var/log/virtualmin/site3.com_error_log
CustomLog /var/log/virtualmin/site3.com_access_log combined
ScriptAlias /cgi-bin/ /home/tcc/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/tcc/public_html>
Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch 
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
AddType application/x-httpd-php5.6 .php5.6
AddType application/x-httpd-php .php
</Directory>
<Directory /home/tcc/cgi-bin>
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
</Directory>
</VirtualHost>

<VirtualHost *:80>
ServerName site4.com
ServerAlias www.site4.com
ServerAlias webmail.site4.com
ServerAlias admin.site4.com
DocumentRoot /home/jmp/public_html
ErrorLog /var/log/virtualmin/site4.com_error_log
CustomLog /var/log/virtualmin/site4.com_access_log combined
ScriptAlias /cgi-bin/ /home/jmp/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/jmp/public_html>
Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch 
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
AddType application/x-httpd-php5.6 .php5.6
AddType application/x-httpd-php .php
</Directory>
<Directory /home/jmp/cgi-bin>
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
</Directory>
</VirtualHost>
last line in /etc/httpd/conf/httpd.conf

Code:
IncludeOptional conf.d/*.conf

and Listen 80 is uncommented
now I'm really becoming disillusioned with fedora, how sad.. after having fedora 12, hosting 14 websites both http and https, plus mail, running non-stop for 4 years with only a little maintenance (every 6 months or so) I meet fedora 21 and up..

We find new demons (ever wonder why they call services on Linux that??? LOL) mysql is now marianDB, there's a new firewalld thingy replacing iptables and Linux firewall, http.conf is now split-up into different conf files and all the good security tweaks I did to apache, SSH, ftp and mail on my fedora 12 box are now hidden or built into the demons so you can't change them (or I haven't figured out how yet)....

and to top it off NOWHERE can I find a step by step tutorial on how to setup a secure working LAMP for anything above fedora 18

I posted this on another fedora forum and Over 150 people have read this post but not one single person has made a suggestion or idea which leads me to believe we are all dazed and confused about the "New and Improved" Fedora. After using fedora for the past 15 years on my web servers, maybe it's time to say goodbye to and old love and move on, if no one can help educate an old man.


correction... I have the LAMP installed what I need is troubleshooting tips for fedora 21 as a web server... LOL
 
Old 06-14-2017, 01:28 PM   #2
hivtop
Member
 
Registered: Jan 2005
Location: In the Desert
Distribution: RedHat 9
Posts: 33

Original Poster
Rep: Reputation: 15
ps.. I turned off iptables, selinux and firewalld for testing will work on them after I get the sites working
 
Old 06-17-2017, 10:17 PM   #3
hivtop
Member
 
Registered: Jan 2005
Location: In the Desert
Distribution: RedHat 9
Posts: 33

Original Poster
Rep: Reputation: 15
No one has any Ideas???? got to be MUCH smarter people than me out there reading this post who can point me in any direction.

O'ya I set the doc root "/home" to 775 apache:apache which didn't help...
 
Old 06-17-2017, 11:55 PM   #4
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,876

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
Well, when considering "how do I do everything?" type questions such as yours, I generally lose interest once the scope of a potentially useful answer becomes apparent - dunno about anyone else, but your response rate speaks for itself.
Do some research, maybe start at the "what's new" pages for each release you have missed, or strt fresh with the docs for the current versions you are running now, and ask some specific questions about stuff that doesn't require potential responders to start with "First, the universe cooled ..."
 
Old 06-19-2017, 01:05 PM   #5
hivtop
Member
 
Registered: Jan 2005
Location: In the Desert
Distribution: RedHat 9
Posts: 33

Original Poster
Rep: Reputation: 15
thanks for your reply descendant_command to start with "if a potentially useful answer was apparent" I wouldn't be here. I have done lots of research, read tons of what's new in apache 2.4 and bind 9.9 (that's how I discovered the new firewalld and iptables for v4 and v6).

I posted my vhost file and httpd config lines to see if someone could find something wrong with them.

my "response rate" is due to the fact I have 14 websites to get back up and running and to let people know what I have been trying so suggestions from someone are not duplicated.

Next.. I remember when "First, the universe cooled ..." I was there running my own dedicated server back in 1992. (before that it was gopher and bulletin boards with 300bps dialup modems (I think I paid $700 for it) which took 5 min to download a 50k file) LMAO

you want specific questions...

1. is there anything wrong with my vhost file?
2. what should the doc root "/home" permissions be set to?
3. should each website have it's own *.conf file?
4. where can I find examples of WORKING httpd.conf, vhost.conf and bind 9.9 .host files for fedora 21? (or can someone send me copies... there are LOTS of piecemill ones out there but can't find complete ones)

none of my replies are me being a smartas*... they are all in fun so PLEASE take them that way.. Life is way to short for confrontations...
 
Old 06-20-2017, 04:09 AM   #6
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,876

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
Quote:
Originally Posted by hivtop View Post
none of my replies are me being a smartas*... they are all in fun so PLEASE take them that way..
Me too

Quote:
to start with "if a potentially useful answer was apparent" I wouldn't be here.
I was referring to the process of attempting to formulate a response to an unfocussed post.

Quote:
1. is there anything wrong with my vhost file?
Well, I'm not an expert, and I'm more familiar with the Debian implementation (which I think has some differences from "stock") and not sure what if anything might be handled differently under Fedora.
A couple of things (none of which should be showstoppers):
Your first vhost appears superfluous.
You're mixing 2.2 & 2.4 access control methods (Allow from / Require)

Quote:
2. what should the doc root "/home" permissions be set to?
Readable by your webserver user & writable by whoever needs to write to it (presumably your users).

Quote:
3. should each website have it's own *.conf file?
That's how Debian does it and I find it logical and easy to follow and administer. The "master" apache2.conf contains the default settings for the whole server and each vhost definition file sets the docroot and Servername and makes any required setting modifications for each site.

Quote:
4. where can I find examples of WORKING httpd.conf, vhost.conf and bind 9.9 .host files for fedora 21? (or can someone send me copies... there are LOTS of piecemill ones out there but can't find complete ones)
Well, they are usually pretty specific to each individual config.
My advice would be to wipe out what you have, start with a default install, and build it (again) step by step. It can be problematic trying to massage old configs to fit a new scheme.

Get the "it works" page going, then add a vhost pointing to your first site and get that sorted, then add more - testing and checking logs along the way.
 
Old 06-23-2017, 03:32 PM   #7
hivtop
Member
 
Registered: Jan 2005
Location: In the Desert
Distribution: RedHat 9
Posts: 33

Original Poster
Rep: Reputation: 15
OK everyone finally found the culprit that was keeping my server from resolving host names... it was the bind config file "named.conf" I had to comment out the listen port 53 line like so:
// listen-on port 53 { 127.0.0.1; };

after I did this EVERYTHING works great (http, https, ftp) by ip or domain name.. guess the listen option is NOW built into bind as a default and it didn't like seeing it twice...

I never thought I would live long enough to see Linux developers take away so many controls and try to make it like Windows, a PnP system,, how sad.

Now it's on to see what security controls they have taken away from us...
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache Internal Server Redirection vhost => vhost not working [Debian & Apache 2] Smokin... Linux - Server 1 05-26-2013 12:06 PM
[SOLVED] Apache2 Multiple SSL vhost in different vhost files, does not work LBM Linux - Software 2 09-24-2010 06:06 AM
vhost with ProxyHTMLInterp On/Off correct definition of vhost needed tkmsr Linux - Server 0 07-18-2010 02:12 PM
Apache: Alias is working on ssl vhost but not on mass vhost jonavogt Linux - Software 0 06-07-2005 02:05 PM
vhost on fc2 install. defaults to 1 vhost only knightdog Linux - Newbie 8 11-12-2004 01:45 PM

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

All times are GMT -5. The time now is 07:12 PM.

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