-1

First of all thanks for the help. I'm trying to port a website to a new version of linux (Raspian Jessie), and am having a few issues, apache2 is version 2.4.10. Mainly with getting the cgi-bin folder to update correctly. I've updated the default file in /etc/apache2/sites-available/ to reflect the location that I would like the directory to be, yet apache is still trying to use the old cgi-bin location, thus giving me a 404 when I try to view the page in a web browser. My current config is as follows:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost

    DocumentRoot /var/www/html
    <Directory />
            Options FollowSymLinks
            AllowOverride None
    </Directory>
    <Directory /var/www/html/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride ALL
            Order allow,deny
            allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /var/www/cgi-bin/
    <Directory "/var/www/cgi-bin">
            AllowOverride None
            Options  +ExecCGI -MultiViews +SymLinksIfOwnerMatch
            Order allow,deny
            Allow from all
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined</VirtualHost>

The error log indicates that apache is still looking in the /usr/lib/cgi-bin/ directory for the cgi files and I can't seem to get it to update to the new location. Any thoughts.

dbsEE
  • 3
  • 2
  • Apache does not do what you describe, you must have an error. This virtualhost has no ServerName in it, Do you have other virtualhosts?, the request may be "landing" in another virtualhost if so. Use `apachectl -S` to check the virtualhosts you really have and which is the default/first being loaded. – Daniel Ferradal Aug 23 '16 at 22:34
  • There is only one virtualhost on the system, the config that I'm going off of from a currently deployed system, did not include a ServerName entry, if it is now required I will add it. The return from the command you suggested is: `VirtualHost configuration: ServerRoot: "/etc/apache2" Main DocumentRoot: "/var/www/html" Main ErrorLog: "/var/log/apache2" Mutex default: dir="/var/lock/apache2" mechanism=fcntl Mutex watchdog-callback: using_defaults PidFile: "/var/run/apache2/apache2.pid" Define: DUMP_VHOSTS Define: DUMP_RUN_CFG Define: ENABLE_USR_LIB_CGI_BIN` – dbsEE Aug 23 '16 at 23:39

1 Answers1

0

You are not using "Include" correctly to load your VirtualHost file, therefore apachectl -S output does not show anything after "VirtualHost configuration:" and it goes on to the next section. There it should list your virtualhost and say it is the default as it is only one.

Review your Include directives

Daniel Ferradal
  • 2,727
  • 1
  • 13
  • 19
  • Reviewing the apache2.conf file (if I'm understanding it correctly), has a statement as follows: `# Include the virtual hosts configurations: IncludeOptional siteds-enabled/*.conf` This is the directory where I have a symlink pointing to the sites-available directory and the desired config file therein. This is the default apache2.config file, Should I change anything? – dbsEE Aug 24 '16 at 15:12
  • siteds? That's a typo. Make sure your Include is correct. Double-check, triple check, and re-check again. Virtualhost details will show in the output of apachectl -S when you have included it correctly. – Daniel Ferradal Aug 24 '16 at 17:06
  • I typo-ed when I put it on here. Though thanks to your advice I was triple checking everything and noticed that the .conf extension was missing from then files in /sites-available. Probably from my trying to copy in the files from a deployed version of the site to a new install on a newer OS. – dbsEE Aug 29 '16 at 16:06