Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: Issue starting apache2 after setting up virtual host

  1. #1
    Join Date
    Aug 2013
    Beans
    11

    Issue starting apache2 after setting up virtual host

    I have Ubuntu 13.04 (GNU/Linux 3.8.0-34-generic x86_64) installed on my system and I use this system as a media and smb server.
    I wanted to be able to listen to my music on my server remotely. I talked with a friend who suggested to use an old program that is no long in the Debian repositories Gnump3d.
    Which I believe is setup correctly, and can be accessed.
    I have a really slow internet connection 700kbps - 1.2mbps Down, 192kbps or under. Up.
    I've been able to listen to the music on my server remotely with my host name or using my local ip, but I've been having issues with skipping. Ie. replaying the same song without finishing or just skipping through the songs all together.
    In a sight walk through it was suggested to install apache2, which I did. Since I had been having issues with skipping, I attempted to down sample the mp3 tracks with lame, but it didn't improve.
    So I found an article to use apache2 to rate limit http://blog.edseek.com/archives/2008...22-and-mod_bw/, but I have never created a virtual host so I used this article to make the virtual host https://www.digitalocean.com/communi...untu-12-04-lts
    I completed the steps in the virtual host article, but when I tried to restart apache2 I get:

    administrator@servermy:~$ sudo service apache2 restart
    sudo: /var/lib/sudo writable by non-owner (040775), should be mode 0700
    [sudo] password for administrator:
    * Restarting web server apache2 Action 'start' failed.
    The Apache error log may have more information.
    [fail]

    So I looked in /var/log/apache2/error.log and found:

    Unable to open logs
    (2)No such file or directory: apache2: could not open error log file /etc/apache2/$/var/log/apache2/xxxxx.dyndns-ip.com_error.log/error.log.

    I don't know what I have to do fix this????
    Last edited by jesse3; December 13th, 2013 at 03:29 AM.

  2. #2
    Join Date
    Jun 2006
    Location
    Houston, TX
    Beans
    1,302
    Distro
    Ubuntu 6.06

    Re: Issue starting apache2 after setting up virtual host

    It is trying to place you log file in /etc... You have 2 lines in your config file on one line, essentially. Get the config file, and look for the /var/log/apache2/xxxxx.dyndns-ip.com_error.log/error.log line and fix your typo.

  3. #3
    Join Date
    Aug 2013
    Beans
    11

    Re: Issue starting apache2 after setting up virtual host

    Quote Originally Posted by houstonbofh View Post
    It is trying to place you log file in /etc... You have 2 lines in your config file on one line, essentially. Get the config file, and look for the /var/log/apache2/xxxxx.dyndns-ip.com_error.log/error.log line and fix your typo.
    I typed sudo nano /etc/apache2/sites-available/xxxxx.dyndns-ip.com
    Edited the lines to:
    ErrorLog $ /var/log/apache2/xxxxxx.dyndns-ip.com_error.log

    CustomLog $ /var/log/apache2/xxxxxx.dyndns-ip.com_access.log combined

    Both files are in /var/log/apache2/

    But I still get in the default error log

    (2)No such file or directory: apache2: could not open error log file /etc/apache2/$/var/log/apache2/xxxxxx.dyndns-ip.com_error.log/error.log.
    Unable to open logs

  4. #4
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Issue starting apache2 after setting up virtual host

    Post your entire virtualhost configuration please.
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  5. #5
    Join Date
    Aug 2013
    Beans
    11

    Re: Issue starting apache2 after setting up virtual host

    Quote Originally Posted by CharlesA View Post
    Post your entire virtualhost configuration please.
    GNU nano 2.2.6 File: ...c/apache2/sites-available/xxxxxx.dyndns-ip.com Modified



    _<VirtualHost *:80>

    ServerAdmin administrator@xxxxxx.dyndns-ip.com *



    DocumentRoot /var/www/xxxxxx.dyndns-ip.com/public_html
    <Directory />

    Options FollowSymLinks

    AllowOverride None

    </Directory>

    <Directory /var/www/>

    Options Indexes FollowSymLinks MultiViews *

    AllowOverride None

    Order allow,deny

    allow from all

    </Directory>



    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">

    AllowOverride None

    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch

    Order allow,deny

    Allow from all

    </Directory>

    ErrorLog $ /var/log/apache2/xxxxxx.dyndns-ip.com_error.log

    # Possible values include: debug, info, notice, warn, error, crit,

    # alert, emerg.

    CustomLog $ /var/log/apache2/xxxxxx.dyndns-ip.com_access.log combined
    </VirtualHost>
    Last edited by jesse3; December 16th, 2013 at 09:18 PM.

  6. #6
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Issue starting apache2 after setting up virtual host

    Quote Originally Posted by jesse3 View Post
    * GNU nano 2.2.6 File: ...c/apache2/sites-available/xxxxxx.dyndns-ip.com Modified *
    * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
    _<VirtualHost *:80> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
    * * * * ServerAdmin administrator@xxxxxx.dyndns-ip.com * * * * * * * * * * * * * **
    * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
    * * * * DocumentRoot /var/www/xxxxxx.dyndns-ip.com/public_html * * * * * * * * * **
    * * * * <Directory /> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
    * * * * * * * * Options FollowSymLinks * * * * * * * * * * * * * * * * * * * * * * **
    * * * * * * * * AllowOverride None * * * * * * * * * * * * * * * * * * * * * * * * **
    * * * * </Directory> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * **
    * * * * <Directory /var/www/> * * * * * * * * * * * * * * * * * * * * * * * * * * * *
    * * * * * * * * Options Indexes FollowSymLinks MultiViews * * * * * * * * * * * * * *
    * * * * * * * * AllowOverride None * * * * * * * * * * * * * * * * * * * * * * * * **
    * * * * * * * * Order allow,deny * * * * * * * * * * * * * * * * * * * * * * * * * **
    * * * * * * * * allow from all * * * * * * * * * * * * * * * * * * * * * * * * * * **
    * * * * </Directory> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * **
    * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
    * * * * ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ * * * * * * * * * * * * * * * * * * *
    * * * * <Directory "/usr/lib/cgi-bin"> * * * * * * * * * * * * * * * * * * * * * * **
    * * * * * * * * AllowOverride None * * * * * * * * * * * * * * * * * * * * * * * * **
    * * * * * * * * Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch * * * * * * * * **
    * * * * * * * * Order allow,deny * * * * * * * * * * * * * * * * * * * * * * * * * **
    * * * * * * * * Allow from all * * * * * * * * * * * * * * * * * * * * * * * * * * **
    * * * * </Directory> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * **
    * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
    * * * * ErrorLog $ /var/log/apache2/xxxxxx.dyndns-ip.com_error.log * * * * * * * * *
    * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
    * * * * # Possible values include: debug, info, notice, warn, error, crit, * * * * **
    * * * * # alert, emerg. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
    * * * * LogLevel warn * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
    * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
    * * * * CustomLog $ /var/log/apache2/xxxxxx.dyndns-ip.com_access.log combined * * *
    </VirtualHost> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * **
    *
    I hope nano is the one adding all those asterisks. Remove the character in red. Then restart apache2.
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  7. #7
    Join Date
    Aug 2013
    Beans
    11

    Re: Issue starting apache2 after setting up virtual host

    Quote Originally Posted by CharlesA View Post
    I hope nano is the one adding all those asterisks. Remove the character in red. Then restart apache2.
    Changed the virtual host by removing $ but I get the same error

  8. #8
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Issue starting apache2 after setting up virtual host

    I'm guessing it has to do with the way you are referencing the log location.

    I checked my old web server and this is what the virtualhost looks like:

    Code:
    <VirtualHost *:80>
            ServerAdmin webmaster@localhost
            ServerName charlesa.net
            DocumentRoot /home/charles/site/charlesa.net/
            ErrorLog ${APACHE_LOG_DIR}/error.log
    
            # Possible values include: debug, info, notice, warn, error, crit,
            # alert, emerg.
            LogLevel warn
            CustomLog ${APACHE_LOG_DIR}/access.log combined
    </VirtualHost>
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  9. #9
    Join Date
    Aug 2013
    Beans
    11

    Re: Issue starting apache2 after setting up virtual host

    Quote Originally Posted by CharlesA View Post
    I'm guessing it has to do with the way you are referencing the log location.

    I checked my old web server and this is what the virtualhost looks like:

    Code:
    <VirtualHost *:80>
            ServerAdmin webmaster@localhost
            ServerName charlesa.net
            DocumentRoot /home/charles/site/charlesa.net/
            ErrorLog ${APACHE_LOG_DIR}/error.log
    
            # Possible values include: debug, info, notice, warn, error, crit,
            # alert, emerg.
            LogLevel warn
            CustomLog ${APACHE_LOG_DIR}/access.log combined
    </VirtualHost>
    Backed up my virtual host file realized that I was missing a few lines at the top but that was there when I was having the issue before so I changed mine to yours but still had the same issue, I looked in the /etc/apache2 folder and seen $error.log. and $xxxxxx.dyndns-ip.com_error.log.
    So I removed both files and I got unable to open error log /etc/apache2/{APACHE_LOG_DIR}/error.log, so I changed the line to just line to just error.log then I got the same error msg as before.
    Last edited by jesse3; December 23rd, 2013 at 11:38 PM.

  10. #10
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Issue starting apache2 after setting up virtual host

    Something in your apache config is messed up.

    I guess you could purge and reinstall apache, but this would take the web server down until you get Apache set up again.

    Code:
    sudo apt-get purge apache2 apache2.2-common
    Code:
    sudo apt-get install apache2
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •