Location of config files when deploying Symfony - apache

I'm trying to deploy a Symfony 3 application on Kimsufi of OVH.
Everything works on my local machine, but when I deploy I get the error (debug mode is on) :
The file "/home/remiblaiyb/app/app/config/routing.yml" does not exist.
Symfony seems to search on app/app for config, I have no idea why.
Do you have any suggestion? Thank you very much.
EDIT: I finally found the answer. It's due to the new way of getting the project directory in Symfony: Symfony looks after the composer.json file, which I didn't upload in prod!
So do not forget to include your composer.json into your project.
Thanks!

Related

Setup VueJS In Subdirectory

I have a VueJS app that I would like to deploy, i'm currently running npm run build to build the app, however I want this app to be in a subdirectory of my website.
The problem i'm having is when building the app, it creates the wrong paths to the css and javascript file.
I have tried using root inside babel.config.js but it gives me an error when I try to build it (root is only allowed in root programmatic options).
Anyone know how I can go about fixing this issue? Any help is greatly appreciated!
Check out the publicPath and base options:
https://cli.vuejs.org/config/#publicpath
https://router.vuejs.org/api/#base
Possibly you will also need to adjust your webserver config if using history mode:
https://router.vuejs.org/guide/essentials/history-mode.html#example-server-configurations

aspnetcoremoduleV2 missing from iis modules after running the runtime bundle

I dont have aspnetcoremoduleV2 in iis modules, even after installing the runtime/hosting bundle
so I cant deploy or test any core service
P.S: I used to have the moduleV2 in iis, but I accidentally deleted some files from C:/inetpub folder (not 100% sure if any files were actually deleted), but since then the module disappeared and all core apps are giving me
"aspNetCore" has a bad module "AspNetCoreModuleV2" in its module list using IIS"
in folder Systerm32/inetsrv the module is missing, when I tried to add it manually and and it in the app.hosting file the iis (sort of crashed) no app was able to run until I removed these Manuel edits
I tried to re-install iis several time/ reinstall the bundle but had to luck
following from #brandoZhang's answer & iis docs here
I have done the following and its now working
1- delete the current aspNetCoreModule (I guess this part was unnecessary)
2- install the module manually if it doesnt appear in iis modules after downloading the runtimebundle
open cmd as admin
navigate to inetSrv location "C:\Windows\System32\inetsrv"
run: appcmd.exe install module /name:AspNetCoreModule /image:%windir%\system32\inetsrv\aspnetcore.dll
ans same for aspnetcoremoduleV2, but its location is in different place
mine was in %Program Files%\IIS\Asp.Net Core Module\V2\aspnetcorev2.dll
if a duplication error appeared, delete the old one and then re install it

How to customize Error Pages on prod environment without debug on Symfony 4.0

I know there is similar question on stackoverflow but they are for previous version of symfony and I didn't find any solution to my problem.
I've just migrated from symfony 3.3 to symfony 4.0 and I can't manage to migrate customization of error pages.
I did what is explained on https://symfony.com/doc/current/controller/error_pages.html.
So I put an error.html.twig file, an error404.html.twig file and an exception.html.twig file on templates\bundles\TwigBundle\Exception repository.
In my prod environment, it's working just fine when debug is true. It uses exception.html.twig template. But when debug is false, it didn't work and the default symfony template is displayed instead of mine.
I can't find any idea why? Do you?
This is what worked for me:
1) Check ownership & permissions on your templates and template directories. From the templates directory, you could:
sudo chown -R www-data:www-data *
2) Then shut off debugging in your .env file by removing the APP_DEBUG line, or setting it to false:
APP_ENV=prod
APP_DEBUG=false
3) Finally, in the project root, clear the Symfony cache:
bin/console cache:clear
Add APP_DEBUG=0 in your .env file
Note that APP_DEBUG=false didn't work for me in Symfony 4
See : https://symfony.com/doc/current/configuration/environments.html#index-3

Change Hippo repository path

Help me please!
My web application running on the server with Ubunta. Jenkins takes the code shown on Bitbucket, and then sets it and manually loads the war files in the Tomcat, that's not deployed by cargo. The problem is in the fact that when I manually brush my folder with the web application, then the next time when i install, all data from the repository( settings, users) disappear. I tried to configure auto export in the console, but the button is not active and press on the checkbox in the Configuration/ Modules/Autoexport also does not help. On the local machine everything works, button is active and data exported to the folder 'bootstrap' to the folder with the project. But on the server is no folders with the project, it on the Bitbucket. And the inclusion of auto exports to the configuration pom.xml file in the cargo.run plugin too does not fit, that's Jenkins not deployed through the cargo, and loads the war files in the Tomcat. Is there another way to change the Hippo repository path?
You can use -Drepo.path startup option. For more options please see this link:
Repository Deployment Settings
Automatic export functionality is there to help you during development, so on your local machine. It is started when configuring it in the cargo.run profile. This profile is typically not used on production servers.
More info on Automatic Export can be found here: http://www.onehippo.org/7_8/library/development/automatic-export-add-on.html
-Drepo.path = /path
-Drepo.Config = /repository.xml -> for database config http://www.onehippo.org/7_7/library/deployment/configuring/configuring-hippo-7-for-mysql.html

Basics of packaging Jruby on Rails for Tomcat

I have a sample rails app that works just fine when run normally. However, I cannot seem to get it packaged as a war that will deploy into Tomcat 7. Warbler seems to be not generating the web.xml file. What is the best way to package a simple war file that will run in Tomcat?
The book deploying Rails with Jruby has a good run down of this.
The basics are:
warble config
(generates the warble.rb file)
Adjust that file to suit your needs then:
warble executable war or just plain warble might work.
warble -T lists all the tasks that warble can do.
Inside the warble.rb file you can add options that show up on your web.xml file when the war is created.
For example this line:
config.webxml.jruby.max.runtimes = 4
puts the config option in the webxml.