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? :)










share|improve this question


























    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? :)










    share|improve this question
























      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? :)










      share|improve this question













      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 7 at 9:10









      Julio María Meca Hansen

      782729




      782729





























          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          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






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          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





















































          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







          這個網誌中的熱門文章

          Academy of Television Arts & Sciences

          L'Équipe

          1995 France bombings