[Techtalk] Accessing a web page on my server

chris chris.madrone at gmail.com
Sun Feb 3 21:36:40 UTC 2013


hrm, I'm sorry that didn't work.   Apache on Ubuntu is set up a little differently from other distributions.  The Apache directory structure is usually something like this:

/etc/apache2/apache2.conf  -> this is the "main" configuration file that may be upgraded with Apache upgrades so I usually don't do much here

/etc/apache2/httpd.conf -> this is where I usually place my global configs as it shouldn't be overwritten by Apache upgrades

/etc/apache2/ports.conf -> this is where you would set up e.g. ssl and other ports

/etc/apache2/envvars -> this is where you might change the Apache "run-as" user and group and set the path for the Apache PID

/etc/apache2/conf.d/charset  -> set to utf8 by default, but you can change it to whatever (not critical at this stage)

/etc/apache2/conf.d/localized_errors_pages -> if you need to set up custom HTTP error pages

/etc/apache2/conf.d/security -> set ServerSignature, ServerTokens, TraceEnable etc. (these are best practice settings, not critical to getting Apache to run)

The other inhabitants of the /etc/apache2 directory are:

mods-available -> this is where mods go after you've run apt-get/aptitude modName
mods-enabled -> to enable a mod, you run sudo a2enmod which creates a symlink from the specific module in the mods-enabled directory to the module which actually lives in mods-available.

sites-available -> by default the Ubuntu Apache configuration is usually set up for VirtualHosting and sites-available is where each VirtualHost lives.  By ubuntu convention, you usually create an individual file for each site although you could also place all your VirtualHost settings into 1 big file (some tutorials will have you editing apache.conf or httpd.conf)

sites-enabled ->  similar to mods, you enable a VirtualHost by sudo a2ensite siteName (defined in VirtualHost file)

I usually copy a virtualhost file and edit it with the new site name.  This only works if you copy in the sites-available folder, not the sites-enabled (the file has to live in sites-available in order for a2ensite to find it and enable it)

So, that's the basic setup.  Of course, that's all assuming that you installed Apache from the Ubuntu sources, not manually? 

usually when I get to the point where I've tried a bunch of things from a bunch of different tutorials, I usually uninstall, purge and reinstall and start over.  Even if I get it working. If I don't really know why it's working I won't be able to troubleshoot it when I do something else that breaks it.

hth
- chris

On Feb 3, 2013, at 12:32 PM, Billie Walsh <bilwalsh at swbell.net> wrote:

> Probably me. I'm sure I borked something somewhere. Whatever it was it didn't work.
> 
> I even created a link to the page I had uploaded on the default "It Works" page and can't access it there either.
> 
> On 02/03/2013 01:16 PM, chris wrote:
>> I just tested this out on my Ubuntu 12.04 (it should translate to your xubuntu install?) and it worked well. Hpe it helps!
>> 
>> 1. enable the userdir module:
>> 
>> sudo a2enmod userdir
>> 
>> 2. edit /etc/apache2/mods-enabled/userdir.conf file (if needed - mine had this in it by default):
>> <IfModule mod_userdir.c>
>>         UserDir public_html
>>         UserDir disabled root
>> 
>>         <Directory /home/*/public_html>
>>                 AllowOverride FileInfo AuthConfig Limit Indexes
>>                 Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
>>                 <Limit GET POST OPTIONS>
>>                         Order allow,deny
>>                         Allow from all
>>                 </Limit>
>>                 <LimitExcept GET POST OPTIONS>
>>                         Order deny,allow
>>                         Deny from all
>>                 </LimitExcept>
>>         </Directory>
>> </IfModule>
>> 
>> 3. edit /etc/apache2/mods-enabled/php5.conf
>> comment out the following:
>> #    <IfModule mod_userdir.c>
>> #        <Directory /home/*/public_html>
>> #            php_admin_value engine Off
>> #        </Directory>
>> #    </IfModule>
>> #</IfModule>
>> 
>> 4. restart apache
>> sudo service apache2 restart
>> 
>> 5. create your public directory and a test file
>> mkdir ~/public_html
>> vi index.html
>> 
>> 6. test in your browser at http://www.yourdomain.com/~youruserdirectory/
>> 
>> 
>> cheers
>> chris
>> 
>> On Feb 3, 2013, at 6:07 AM, Billie Walsh <bilwalsh at swbell.net> wrote:
>> 
>>> Fall back five yards and punt.
>>> 
>>> What I'm needing to find, according to http://httpd.apache.org/docs/2.2/howto/public_html.html :
>>> 
>>> <quote>
>>> Note that, by default, access to these directories is *not* enabled. You can enable access when using |UserDir <http://httpd.apache.org/docs/2.2/mod/mod_userdir.html#userdir>| by uncommenting the line
>>> 
>>> |#Include conf/extra/httpd-userdir.conf |
>>> 
>>> in the default config file, and adapting the |httpd-userdir.conf| file as necessary, or by including the appropriate directives in a |Directory| block within the main config file.
>>> <unquote>
>>> 
>>> It then goes on to tell you all the gory details of what and why but not where. The "tutorial" obviously was written to someone that has a certain amount of expertise/training already. Something I totally lack.
>>> 
>>> I have no idea what the "default configuration file" is or where it is. No file I can find has the commented out line I need to uncomment. After that I will need to edit other files to direct Apache to the chosen user space. One step at a time. Find the needed file and edit the line. Then edit the config files to point to the chosen directory.
>>> 
>>> The techytalk link Akkana sent tells how to point apache to the user space for all users listed in the system users list. Helpful for later.
>>> 
>>> Thank you for all you do and you patient understanding of my ignorance.
>>> 
>>> Please believe me. When I'm not actively doing the steps and reading the links you send I'm googling like crazy on my own.
>>> 
>>> -- 
>>> 
>>> "Only two things are infinite, the universe and human stupidity, and I'm not sure about the former."
>>> -Albert Einstein
>>> 
>>> 
>>> _ _...  ..._ _
>>> _._  ._  .....  ._..  ...  .._
>>> 
>>> _______________________________________________
>>> Techtalk mailing list
>>> Techtalk at linuxchix.org
>>> http://mailman.linuxchix.org/mailman/listinfo/techtalk
>> 
> 
> 
> -- 
> 
> “Only two things are infinite, the universe and human stupidity, and I’m not sure about the former.”
> -Albert Einstein
> 
> 
> _ _...  ..._ _
> _._  ._  .....  ._..  ...  .._
> 
> _______________________________________________
> Techtalk mailing list
> Techtalk at linuxchix.org
> http://mailman.linuxchix.org/mailman/listinfo/techtalk



More information about the Techtalk mailing list