moonlight
moonlight

Reputation: 821

Laravel not working showing Apache default page on localhost. Virtual Host changes failed

I have to make LAravel app and to deliver a Dockerfile ,but i'm realy stuck with this. Before that I had a nightmare wile installing laravel on my machine.

I'm trying to get dockervel image and I'm following the steps here: http://www.spiralout.eu/2015/12/dockervel-laravel-development.html

I had problems before and made changes :Error starting userland proxy: listen tcp0.0.0.0:3306: bind: address already in use

All good till the step

fix permissions: dpermit Now you have a registration system active. Go to localhost and register a new user to see that db's are running ok.

When I go to localhost I get : Apache2 Ubuntu Default Page https://assets.digitalocean.com/articles/lamp_1404/default_apache.png

I have catched this : when I run

$ dcomposer-create
It gets to the end but I get this 
Warning: This development build of composer is over 60 days old. It is recommended to update it by running "/usr/bin/composer self-update" to get the latest version.
Installing laravel/laravel (v5.2.31)
  - Installing laravel/laravel (v5.2.31)
    Downloading: 100%         

Created project in /var/www
> php -r "copy('.env.example', '.env');"

Shoud I move on eith installation or first fix this?

I alredy have a laravel project in var/www/laravel (on local laravel environment). And my etc/hosts file looks like :

127.0.0.1   laravel.example.com
127.0.1.1   me-Lenovo-Z50-75

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
127.0.0.1  laravel.example.com

And $ dcomposer-create creates application in dockervel/www/ .

I have changeg now made dockervel.example.com.conf in /etc/apache2/sites-available

<VirtualHost *:80>

        ServerName dockervel.example.com
        DocumentRoot /home/me/Desktop/dockerlaravel/dockervel/www/public
        DirectoryIndex index.php

        <Directory /home/me/Desktop/dockerlaravel/dockervel/www>
                Options FollowSymLinks
                AllowOverride None
        </Directory >
        <Directory >
                AllowOverride All
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log
        LogLevel warn
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

And changed /etc/hosts

127.0.0.1  dockervel.example.com
127.0.1.1   me-Lenovo-Z50-75

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
127.0.0.1  dockervel.example.com

I also run:

$ a2ensite dockervel.example.com
$ sudo service apache2 reload

And When I run :

apachectl -S
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
VirtualHost configuration:
*:80                   is a NameVirtualHost
         default server 127.0.1.1 (/etc/apache2/sites-enabled/000-default.conf:1)
         port 80 namevhost 127.0.1.1 (/etc/apache2/sites-enabled/000-default.conf:1)
         port 80 namevhost dockervel.example.com (/etc/apache2/sites-enabled/dockervel.example.com.conf:1)
         port 80 namevhost laravel.example.com (/etc/apache2/sites-enabled/laravel.example.com.conf:1)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex watchdog-callback: using_defaults
Mutex default: dir="/var/lock/apache2" mechanism=fcntl 
Mutex mpm-accept: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33
Group: name="www-data" id=33

And when I continue with the instalation

$ dnodejs nmp install - this is ok 
$ dnodejs gulp install
[17:40:09] Using gulpfile /var/www/gulpfile.js
[17:40:09] Task 'install' is not in your gulpfile
[17:40:09] Please check the documentation for proper gulpfile formatting

As you can see ,All goes in /var/www but I want it to be in my working directory /home/me/Desktop/dockerlaravel/dockervel .

I can not see what is the problem is the problem?

Upvotes: 1

Views: 5321

Answers (1)

Spiral Out
Spiral Out

Reputation: 1155

Since you have changed the port to "8084" you should go to localhost:8084 If you see the apache default then you probably are browsing another server since dockervel is build upon nginx.
You have also probably have some gaps on Docker. Don't mix your local storage with docker storage. /var/www in a container is different than your local /var/www. in docker-compose.yml you mount the local ~/dockervel/www to containers /var/www.
I would suggest that you start all over again and revert the changes you've made to your apache server. Shut it down, you don't need it. Dockervel will provide you with an NginX server in a container.

Upvotes: 1

Related Questions