correct steps to serve Apache virtual hosts from $HOME in Fedora
up vote
0
down vote
favorite
I'm testing Fedora 29 (I've been a Debian user for the last 10 years) for web development and I'm having a real hard time trying to make virtual hosts work in Apache (I assume it's lack of understanding on my part, to be honest).
This is the folder structure I want to work with (I know I'm deviating from the standard /var/www/html way of doing things):
/home
/julio
/Projects
/Web
/meca-innotech.com
So far, and in order to work with virtual hosts, I created the 'basic' folders and symlinks (just one for testing):
/etc
/httpd
/sites-available
meca-innotech.com.conf
template.conf
/sites-enabled
meca-innotech.com.conf -> /etc/httpd/sites-available/foo.conf
In order for this to work, I also made a change in /etc/httpd/conf/httpd.conf:
# Virtual host definitions
IncludeOptional sites-enabled/*.conf
My virtual host definition looks like this:
<VirtualHost *:80>
ServerName meca-innotech.com
DocumentRoot /home/julio/Projects/Web/meca-innotech.com
</VirtualHost>
In order to make sure Apache resolves against a valid FQDN, I added the proper line to /etc/hosts:
192.168.1.77 jmecahansen-E1-570G.meca-innotech.com jmecahansen-E1-570G
127.0.0.1 meca-innotech.com
I also configured /etc/sysconfig/network:
HOSTNAME=jmecahansen-E1-570G
I ran httpd -S and it didn't show any errors. I also started the Apache service with sudo systemctl start httpd and everything went fine.
The problem is I'm not probably having the correct permissions or I'm lacking something I don't see by myself. For example, I've read (in SO, blog posts, some google'd sites and the output of /var/log/httpd/error_log) your home directory needs to be, at least, executable. That means the /home/julio directory needs to be chmod'ed to either 710 or 711.
Another thing I've read is Apache needs to be related to your user group so I tried with usermod -a -G julio apache but that doesn't seem to help.
Other sources for information states that you need to enable the Apache Userdir extension and run some SELinux-related commands which I don't understand at all.
Maybe I'm overdoing this and everything is reduced to follow the standard /var/www/html path and ensuring my user is a member of Apache and have the proper permissions on the aforementioned path.
In any case, I would greatly appreciate a helping hand with this. Can you give me a hint? :)
apache virtualhost fedora
add a comment |
up vote
0
down vote
favorite
I'm testing Fedora 29 (I've been a Debian user for the last 10 years) for web development and I'm having a real hard time trying to make virtual hosts work in Apache (I assume it's lack of understanding on my part, to be honest).
This is the folder structure I want to work with (I know I'm deviating from the standard /var/www/html way of doing things):
/home
/julio
/Projects
/Web
/meca-innotech.com
So far, and in order to work with virtual hosts, I created the 'basic' folders and symlinks (just one for testing):
/etc
/httpd
/sites-available
meca-innotech.com.conf
template.conf
/sites-enabled
meca-innotech.com.conf -> /etc/httpd/sites-available/foo.conf
In order for this to work, I also made a change in /etc/httpd/conf/httpd.conf:
# Virtual host definitions
IncludeOptional sites-enabled/*.conf
My virtual host definition looks like this:
<VirtualHost *:80>
ServerName meca-innotech.com
DocumentRoot /home/julio/Projects/Web/meca-innotech.com
</VirtualHost>
In order to make sure Apache resolves against a valid FQDN, I added the proper line to /etc/hosts:
192.168.1.77 jmecahansen-E1-570G.meca-innotech.com jmecahansen-E1-570G
127.0.0.1 meca-innotech.com
I also configured /etc/sysconfig/network:
HOSTNAME=jmecahansen-E1-570G
I ran httpd -S and it didn't show any errors. I also started the Apache service with sudo systemctl start httpd and everything went fine.
The problem is I'm not probably having the correct permissions or I'm lacking something I don't see by myself. For example, I've read (in SO, blog posts, some google'd sites and the output of /var/log/httpd/error_log) your home directory needs to be, at least, executable. That means the /home/julio directory needs to be chmod'ed to either 710 or 711.
Another thing I've read is Apache needs to be related to your user group so I tried with usermod -a -G julio apache but that doesn't seem to help.
Other sources for information states that you need to enable the Apache Userdir extension and run some SELinux-related commands which I don't understand at all.
Maybe I'm overdoing this and everything is reduced to follow the standard /var/www/html path and ensuring my user is a member of Apache and have the proper permissions on the aforementioned path.
In any case, I would greatly appreciate a helping hand with this. Can you give me a hint? :)
apache virtualhost fedora
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm testing Fedora 29 (I've been a Debian user for the last 10 years) for web development and I'm having a real hard time trying to make virtual hosts work in Apache (I assume it's lack of understanding on my part, to be honest).
This is the folder structure I want to work with (I know I'm deviating from the standard /var/www/html way of doing things):
/home
/julio
/Projects
/Web
/meca-innotech.com
So far, and in order to work with virtual hosts, I created the 'basic' folders and symlinks (just one for testing):
/etc
/httpd
/sites-available
meca-innotech.com.conf
template.conf
/sites-enabled
meca-innotech.com.conf -> /etc/httpd/sites-available/foo.conf
In order for this to work, I also made a change in /etc/httpd/conf/httpd.conf:
# Virtual host definitions
IncludeOptional sites-enabled/*.conf
My virtual host definition looks like this:
<VirtualHost *:80>
ServerName meca-innotech.com
DocumentRoot /home/julio/Projects/Web/meca-innotech.com
</VirtualHost>
In order to make sure Apache resolves against a valid FQDN, I added the proper line to /etc/hosts:
192.168.1.77 jmecahansen-E1-570G.meca-innotech.com jmecahansen-E1-570G
127.0.0.1 meca-innotech.com
I also configured /etc/sysconfig/network:
HOSTNAME=jmecahansen-E1-570G
I ran httpd -S and it didn't show any errors. I also started the Apache service with sudo systemctl start httpd and everything went fine.
The problem is I'm not probably having the correct permissions or I'm lacking something I don't see by myself. For example, I've read (in SO, blog posts, some google'd sites and the output of /var/log/httpd/error_log) your home directory needs to be, at least, executable. That means the /home/julio directory needs to be chmod'ed to either 710 or 711.
Another thing I've read is Apache needs to be related to your user group so I tried with usermod -a -G julio apache but that doesn't seem to help.
Other sources for information states that you need to enable the Apache Userdir extension and run some SELinux-related commands which I don't understand at all.
Maybe I'm overdoing this and everything is reduced to follow the standard /var/www/html path and ensuring my user is a member of Apache and have the proper permissions on the aforementioned path.
In any case, I would greatly appreciate a helping hand with this. Can you give me a hint? :)
apache virtualhost fedora
I'm testing Fedora 29 (I've been a Debian user for the last 10 years) for web development and I'm having a real hard time trying to make virtual hosts work in Apache (I assume it's lack of understanding on my part, to be honest).
This is the folder structure I want to work with (I know I'm deviating from the standard /var/www/html way of doing things):
/home
/julio
/Projects
/Web
/meca-innotech.com
So far, and in order to work with virtual hosts, I created the 'basic' folders and symlinks (just one for testing):
/etc
/httpd
/sites-available
meca-innotech.com.conf
template.conf
/sites-enabled
meca-innotech.com.conf -> /etc/httpd/sites-available/foo.conf
In order for this to work, I also made a change in /etc/httpd/conf/httpd.conf:
# Virtual host definitions
IncludeOptional sites-enabled/*.conf
My virtual host definition looks like this:
<VirtualHost *:80>
ServerName meca-innotech.com
DocumentRoot /home/julio/Projects/Web/meca-innotech.com
</VirtualHost>
In order to make sure Apache resolves against a valid FQDN, I added the proper line to /etc/hosts:
192.168.1.77 jmecahansen-E1-570G.meca-innotech.com jmecahansen-E1-570G
127.0.0.1 meca-innotech.com
I also configured /etc/sysconfig/network:
HOSTNAME=jmecahansen-E1-570G
I ran httpd -S and it didn't show any errors. I also started the Apache service with sudo systemctl start httpd and everything went fine.
The problem is I'm not probably having the correct permissions or I'm lacking something I don't see by myself. For example, I've read (in SO, blog posts, some google'd sites and the output of /var/log/httpd/error_log) your home directory needs to be, at least, executable. That means the /home/julio directory needs to be chmod'ed to either 710 or 711.
Another thing I've read is Apache needs to be related to your user group so I tried with usermod -a -G julio apache but that doesn't seem to help.
Other sources for information states that you need to enable the Apache Userdir extension and run some SELinux-related commands which I don't understand at all.
Maybe I'm overdoing this and everything is reduced to follow the standard /var/www/html path and ensuring my user is a member of Apache and have the proper permissions on the aforementioned path.
In any case, I would greatly appreciate a helping hand with this. Can you give me a hint? :)
apache virtualhost fedora
apache virtualhost fedora
asked Nov 7 at 9:10
Julio María Meca Hansen
782729
782729
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53186382%2fcorrect-steps-to-serve-apache-virtual-hosts-from-home-in-fedora%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown