0

Is it possible to run Vagrant virtual machines on Ubuntu 14.04? I understand there is no GUI on SSH on this specific VPS server so I assume that is why i'm getting the following error:

The guest machine entered an invalid state while waiting for it to boot. Valid states are 'starting, running'. The machine is in the 'poweroff' state. Please verify everything is configured properly and try again. If the provider you're using has a GUI that comes with it, it is often helpful to open that and watch the machine, since the GUI often has more helpful error messages than Vagrant can retrieve. For example, if you're using VirtualBox, run `vagrant up` while the VirtualBox GUI is open. The primary issue for this error is that the provider you're using is not properly configured. This is very rarely a Vagrant issue. 

The issue is i previously used Laravel Homestead on a Windows machine VM with VirtualBox & Vagrant however; I'm currently looking to move it to a VPS. Should I ignore the virtual machine all together or should I create a box some other way? (is it possible)

12
  • Actually you could just ignore it.. are you hosting a site or? Commented Feb 22, 2017 at 1:20
  • Im hosting a vps server externally and connecting via ssh Commented Feb 22, 2017 at 1:25
  • creating a box would be possible, but if you want to host laravel 5 you can just install it just that there's no GUI so basically everything is command line based. Commented Feb 22, 2017 at 1:27
  • Ill be honest im quite new to the virtualisation side of things which is why i preferred a premade package. Do you think each product installed in homestead is already configured or will it be the same as installing it from scratch? Commented Feb 22, 2017 at 1:31
  • If it's laravel 5 it's literally premade in the package itself. After installation you could just modify it settings. Are you hosting VPS for shared or host sites ? Commented Feb 22, 2017 at 1:33

1 Answer 1

2

As per discussion, these are the following steps to install Laravel 5 on your uBuntu.

Assuming you don't have PHP 5, these are the steps to install it :

$ sudo apt-get install python-software-properties $ sudo add-apt-repository ppa:ondrej/php $ sudo apt-get update $ sudo apt-get install -y php5.6 php5.6-mcrypt php5.6-gd 

If you don't have apache2 installed:

$ apt-get install apache2 libapache2-mod-php5 

If you don't have MYSQL installed:

$ apt-get install mysql-server php5.6-mysql 

Laravel composer is a must to installed, an internet connection is needed:

$ curl -sS https://getcomposer.org/installer | php $ sudo mv composer.phar /usr/local/bin/composer $ sudo chmod +x /usr/local/bin/composer 

Install GIT:

$ apt-get install git 

Enable mbstring extension for Laravel: https://stackoverflow.com/a/33736248/1589224

Install Laravel 5:

$ cd /var/www $ git clone https://github.com/laravel/laravel.git 

Navigate to Laravel code directory and use composer to install all dependencies required for Laravel framework.

$ cd /var/www/laravel $ sudo composer install 

Dependencies installation will take some time. After than set proper permissions on files.

$ chown -R www-data.www-data /var/www/laravel $ chmod -R 755 /var/www/laravel $ chmod -R 777 /var/www/laravel/app/storage 

Now you have to set the encryption key :

Now set the 32 bit long random number encryption key, which used by the Illuminate encrypter service.

$ php artisan key:generate Application key [uOHTNu3Au1Kt7Uloyr2Py9blU0J5XQ75] set successfully. 

Now edit config/app.php configuration file and update above generated application key as followings. Also make sure cipher is set properly.

'key' => env('APP_KEY', 'uOHTNu3Au1Kt7Uloyr2Py9blU0J5XQ75'), 'cipher' => 'AES-256-CBC', 

Next step is creating Apache VirtualHost

Now add a Virtual Host in your Apache configuration file to access Laravel framework from web browser. Create Apache configuration file under /etc/apache2/sites-available/ directory and add below content.

$ nano /etc/apache2/sites-available/laravel.example.com.conf 

You'll either need to be a root or super user to edit it

 ServerName laravel.example.com DocumentRoot /var/www/laravel/public <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/laravel> AllowOverride All </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log LogLevel warn CustomLog ${APACHE_LOG_DIR}/access.log combined 

After you're done , press CTRL+X and type in Y and press Enter

Finally lets enable website and reload Apache service using below command.

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

Final step:

Accessing laravel

$ sudo echo "127.0.0.1 laravel.example.com" >> /etc/hosts 

And access http://laravel.example.com in your favorite web browser as below.

In your case, you move the websites to /var/www/ and you can already view it.

You can also CHOWN Vagrant on Laravel directory as well.

Sign up to request clarification or add additional context in comments.

4 Comments

Hi Freedom! Unfortunately i'm having an issue after installing php with the following: Unable to load dynamic library '/usr/lib/php/20131226/mbstring.dll' - /usr/lib/php/20131226/mbstring.dll: cannot open shared object file: No such file or directory in Unknown on line 0. I'm not sure why PHP is looking there for extensions and i'm not sure where the original folder is. Any idea?
@OliverKuchies, is your ubuntu LAMP stack ?
As discussed there is nothing but Ubuntu 14.04 installed on the system. Its a new vps server
@OliverKuchies, could you this guide : google.com/…

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.