doushi4956
2016-10-16 05:15
浏览 109
已采纳

配置可从浏览器访问的远程Laravel应用程序

All the laravel projects I worked on were installed/configured started by other people. A long time ago I managed to install a Laravel project on a Windows machine using WAMP and it was easier as far as I remember. I recently received access to a clean droplet from digitalocean.com with Centos 7 installed. I think a droplet is something like a VPS. You have an IP, and SSH access After some headache I managed to successfully install laravel using composer. I have also installed mysql and apache(httpd) Now I have

/var/www/laravel

folder, with the installation of the latest Laravel (5.3)

I went inside /var/www/ and called

composer create-project laravel/laravel mypro

Now, I have a laravel app scheleton of a new application at

/var/www/mypro

I would like to access it from a browser so I can start working on it, but I do not know what I need to do. There are many tutorials on how to do that but they are very confusing for me.

What must I do next in order to be able to see the results of what I am working on? If , in the browser, I access now the droplet by IP, like

http://xxx.xxx.xxx.xxx

I get

Not Found The requested URL / was not found on this server.

Same if I add to the URL the name of my app like

http://xxx.xxx.xxx.xxx/mypro

I believe I must configure the httpd ? Or maybe move the project's folder somewhere else?

I tried moving my project folder inside /var/www/html folder, so

/var/www/html/mypro

and now when I try to access the url I receive an empty page (view-source of the browser page returns also an empty page) I even tried

http://xxx.xxx.xxx.xxx/mypro/server.php

since there is a server.php file in the root of my project folder... same result

I even added a conf to the /etc/httpd/conf.d/ folder called mypro.conf where I added these lines:

<VirtualHost *:80>
   ServerName mypro
   DocumentRoot "/var/www/html/mypro/public"
   <Directory /var/www/html/mypro/public>
      AllowOverride all
   </Directory>
</VirtualHost>

Nothing new happens I did "service httpd restart" everytime a changed something.

I even tried

php artisan serve --host xxx.xxx.xxx.xxx --port 8000

and tried the url http://xxx.xxx.xxx.xxx:8000

Now I get "Unable to connect" page from the browser so I stopped the "serve"

What is it that I have to do in order to be able to finally start working?

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题