I am new to symphony2 and I need to know how can I make my application run without the server:run commmand. What do I need to do to be able to make it run inside the root folder of my nginx server on port 80?
There are several steps you need to do.
1. Install Apache or similar web server on your hosting server.
2. Create a virtual host which points to the directory where your Symfony app is.
3. Allow proper permissions to folders.
4. Run your web server from specific console command.
Refer following two URLs for more details:
http://symfony.com/doc/current/cookbook/deployment/tools.html
https://www.digitalocean.com/community/tutorials/how-to-deploy-a-symfony-application-to-production-on-ubuntu-14-04
Related
I am setting up an IIS server in readiness to host multiple PHP web apps. These will be used within our local network so no need internet access. I have read a lot of stuff on how to go about it but am getting lost even more. someone please help.
You can refer to this document for detailed steps about deploy php application on IIS.
Here are some main important points:
Install IIS in control pannel(windows) or server manager(windows server).
Configure php. Youcan download it from php official website or Web PI(more recommand). The version over php8 may not work on IIS.
Make the physical path of site points to root folder of application. It will auto generate web.config. Set the permission of root folder to avoid 500 error.
If you have multiples version of php, you can isntall php manager to configure them.
I am developing a website using Laravel as backend and Vue.js 2 as frontend. Now everytime i want to run my website I have to use 2 command:
php artisan serve
This will run the laravel server on port 8000
npm run dev
This will run the vue.js server on port 8080
Can I just run them on the same server (same port), with just one command only??
If you use the Laravel app with Vue.js included in it, you don't need to run npm run dev.
In your case, you seem to have a decoupled frontend and backend. In that case, you don't really have the choice to host 2 different ports or hostname.
You can use the same port if you use a different domain. For example, you can use mydomain.com for the frontend and use api.mydomain.com for the backend/api.
Assuming you have a webpack frontend project, you can do npm run build, which will compile all your files to static html files in the dist folder. You then only need to point your host configuration file to this folder.
I have my own server how can I run symfony project without creating virtual host.
Do I really need VirtualHost for symfony development?
It all depends on personal preference, if you want to open project with virtual host you can configure it, if not keep like this
localhost/project_folder/web/app_dev.php.
Your symfony app will run with the above URL. I have hosted so many apps on Cloudways and I ran my apps with the URL like this
phpstack-21306-71265-234521.cloudwaysapps.com/fos/web/admin
so I don't need to setup a virtual host either on live server.
I have build a symfony project and uploaded it to my hosting. I want to make it public. I though I just have to use bin/console server:run via SSH, but this isn't the case in production. How do I start my project? When I go to my domain I just get:
Forbidden
You don't have permission to access / on this server.
Even though I have controller with route for "/".
It's not such a good idea to use the internal PHP Webserver to run your project in production. Configure Apache or Nginx for your project and you can't start it because your port is used by the apache Webserver which gives you the Forbidden error.
http://symfony.com/doc/current/setup/web_server_configuration.html
I read and tried several methods and none worked. I always get either 400 or 500 error. The app works perfectly on localhost.
What are the exact steps in order to get Laravel 5 up and running on a VPS with DirectAdmin CP??
Please don't link to other questions as I read them all. Some don't even work with Laravel 5 anymore.
Note: DirectAdmin sees public_html as the document root.
I have SSH root access and Composer is installed.
VPS Configs: Apache 2.4.9 and PHP 7.0.3.
Turns out DirectAdmin has a section where you can define custom Apache configs (including Document root). So here are the steps:
1- Login to your admin area (as System Admin)
2- From Extra features select Custom Httpd Configurations
3- Select the domain you want to config
4- In the textarea at the top enter the following:
|?DOCROOT=/home/username/domains/example.com/public_html/public|
5- Click save. Now wait for a minute or two and voila! It works.
Obviously you need to change the username and example.com according to your setup.
Read more about this feature.