Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I don't find a valid a description how can I install configure the apache vhost correctly. Can everybody help me?

<VirtualHost *:80>
    ServerAdmin webmaster@localhost

    DocumentRoot /home/userdir/

    Alias /php5-fcgi /usr/lib/cgi-bin
    #Alias /php-fpm /home/userdir/
    FastCgiExternalServer /home/userdir/ -flush -pass-header HTTP_AUTHORIZATION -host
    #AddType application/x-httpd-fastphp5 .php
    #Action appication/x-httpd-fastphp5 /php-fpm
    Action php5-fcgi /php5-fcgi
    AddHandler php5-fcgi .php
    ScriptAlias php5-fcgi /home/userdir/

    #DirectoryIndex index.php index.html

    <Directory />
        Options FollowSymLinks +ExecCGI +SymLinksIfOwnerMatch
        #DirectoryIndex index.php
        AllowOverride None

    <Directory /home/userdir/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        #DirectoryIndex index.php
        Order allow,deny
        allow from all

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

    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

And the output in the browser:

Not Found

The requested URL /php5-fcgi/index.php was not found on this server.  

And the apache error log:

File does not exist: /usr/lib/cgi-bin/index.php

share|improve this question
First make clear what you have tried. Then explain what the problem is - installing php5-fpm and apache, or configuring the vhost. – SPRBRN Jun 26 '13 at 8:14
The problem I can't configure properly the vhost. – turbod Jun 26 '13 at 8:18
This is a lot better! If you start out like this, it saves us from trying to explain stuff that you already have working. That's a waste of our/my time, and for me a reason not to put more effort in it. – SPRBRN Jun 26 '13 at 8:49

Create the file /usr/lib/cgi-bin/index.php and put some text in it like "test", then save it. Try again. Furthermore I don't think that you should use a url path like /php5-fcgi. Just http://localhost/index.php (or .html) should do.

share|improve this answer
I use the – turbod Jun 26 '13 at 9:10
I don't understand what you mean. – SPRBRN Jun 26 '13 at 9:15
In don't use the /php5-fcgi in the url. – turbod Jun 26 '13 at 9:23

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.