LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-11-2013, 08:56 PM   #16
baronobeefdip
Senior Member
 
Registered: Jul 2009
Distribution: Debian Squeeze
Posts: 1,267

Original Poster
Rep: Reputation: 32

Quote:
Originally Posted by John VV View Post
is the folder " /var/drupal" owned by "apache" like /var/www is
I did a chown on it like this
Code:
chown -R apache:apache /var/drupal

Quote:
Originally Posted by TommyC7 View Post
Alongside what else has been said, you haven't told us how you turned off SELinux (I recommend keeping it on by the way except for debugging purposes).

If you used:
Code:
setenforce 0
That's not going to survive a reboot.

Also, there's no need to reboot the entire machine if all you're going to do is restart a service or just change the permissions of a directory.

For future reference, use
Code:
sestatus
To see if SELinux is set to enforcing/permissive/disabled.
I diabled SELinux by editing a line in the /etc/selinux/config file
Code:
SELINUX=enforcing
was changed to
Code:
SELINUX=disabled
In the lab I work in they always turn off selinux before doing anything with a red hat machine. So I want to keep selinux off seeing that it's the root to a lot of problems and has been in the past. I just want it to be off. As for the directory piece. I'll try it and see what happens, when I do I'll get back to you

Last edited by baronobeefdip; 06-11-2013 at 09:00 PM.
 
Old 06-11-2013, 09:15 PM   #17
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
Quote:
So I want to keep selinux off seeing that it's the root to a lot of problems
you really want it set to " permissive " while you are working on it
that way any issues that crop up will be in the se log and "audit2alow " will be able to wright a custom rule ( if needed)
and setroubleshooter will give you and instant notification if there was to be any issues .

set the directory entry in the httpd.conf
SEE: post #13
Code:
<Directory /var/drupal/html>
--- options 
--- options 
</Directory>
 
Old 06-11-2013, 09:25 PM   #18
baronobeefdip
Senior Member
 
Registered: Jul 2009
Distribution: Debian Squeeze
Posts: 1,267

Original Poster
Rep: Reputation: 32
here is what the config file looks like
Code:
<VirtualHost *:80>
ServerName drupal.baronobeefdip.josh
DocumentRoot /var/drupal/html
<Directory /var/drupal/html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>

<VirtualHost *:80>
ServerName joomla.baronobeefdip.josh
DocumentRoot /var/www/html
<Directory /var/www/html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>
It works, The site at the top is the default (when I request it through IP address.) and the one at the bottom is the one that is virtual and must be requested with a name. Thanks for your help, it works now.

Last edited by baronobeefdip; 06-11-2013 at 09:30 PM.
 
Old 06-11-2013, 09:44 PM   #19
baronobeefdip
Senior Member
 
Registered: Jul 2009
Distribution: Debian Squeeze
Posts: 1,267

Original Poster
Rep: Reputation: 32
I have a new problem here
Code:
<VirtualHost *:80>
ServerName joomla.baronobeefdip.josh
DocumentRoot /var/www/html
<Directory /var/www/html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>

<VirtualHost *:80>
ServerName drupal.baronobeefdip.josh
DocumentRoot /var/drupal/html
<Directory /var/drupal/html>
Options Indexes FollowSymlinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI}
</VirtualHost>

<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName drupal.baronobeefdip.josh
DocumentRoot /var/drupal/html
<Directory /var/drupal/html>
Options Indexes FollowSymlinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
SSLEngine on
SSLCertificateFile /etc/httpd/ssl/localhost.crt
SSLCertificateKeyFile /etc/httpd/ssl/localhost.key
</VirtualHost>
I can request the hosts joomla.baronobeefdip.josh and drupal.baronobeefdip.josh. I execute the rewrite module like you see here so when I request the drupal host I will be redirected to the other drupal site which deploys ssl on port 443. But what is happening now is that whenever I request the drupal host I get redirected to the joomla one but with an SSL connection. Why is it doing this? I thought virtual host rewrites were relatable with names, so that whenever I do a port 80 request to drupal it will redirect me to the 443 host that uses the drupal directory because it was named drupal. This is more confusing than the last predicament because I now have absolutely no idea what is happening here.
 
  


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
[SOLVED] Apache virtualhost issues Hmail Linux - Server 7 09-19-2012 03:46 AM
Apache VirtualHost's Dreft Linux - Server 1 12-16-2010 02:55 PM
[SOLVED] Apache VirtualHost Help Chris1989 Linux - Server 6 11-08-2009 05:30 PM
Apache virtualhost with 2 ip's djroy Linux - Newbie 2 10-12-2009 01:48 PM
Apache -VirtualHost davidhk Debian 7 08-19-2005 12:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:30 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