PrestaSitemap bundle generates localhost on production server - symfony

I'm using Presta SiteMap Bundle for generating sitemaps on my site, but when it generates to me sitemaps on prod server path to sitemaps looks like below:
http://localhost/sitemap.holidayideas.xml
What should I write in config or anywhere in my app to generate correct url's for my sitemaps.
P.S. I'm using Symfony 3.3.2 for my app

I found the solution - need to specify url and protocol in parameters.yml as below:
# app/config/parameters.yml
parameters:
router.request_context.host: your-domain.com
router.request_context.scheme: http

Related

Can't access kibana with domain

I generated certs for my app using certbot/Letsencrypt. I got two pem files which I added in my kibana.yml file. When I try to access kibana through https://domainName:5601 I get timeout error, while I can access it with IP. Am I missing something?
This is my kibana.yml:
server.name: kibana
server.host: "0.0.0.0"
server.ssl.enabled: true
server.ssl.certificate: "/usr/share/kibana/config/certs/fullchain.pem"
server.ssl.key: "/usr/share/kibana/config/certs/privkey.pem"
If you upgraded with the latest version i.e. 7.x then u need to add server.publicBaseUrl in your kibana.yml
for e.g. server.publicBaseUrl=xyz.com
so it will allow you to redirect your website.
For me it is working fine after adding this parameter inside kibana.yml

document_root on Google App Engine not recognized

I'm running a Symfony 4 app on Google App Engine with a flexible environment config.
public/index.php is the index path from the project root.
I have defined a document_root: public, but it is not recognized.
For example:
https://myproject.appspot.com/ returns a 404.
https://myproject.appspot.com/public/index.php returns a 200.
It doesn't matter if it's a php file or a static resource. I have to add public to the path to access anything. Of course the desired behavior is that public is my document root.
The relevant parts of my app.yml are here:
runtime: php
env: flex
runtime_config:
document_root: public
This follows all the documentation I have found. Any ideas on how to resolve this?
The issue is that I was using a .yml extension instead of .yaml.
Renaming the file from app.yml to app.yaml resolved the issue.

Open files in PHPStorm with Vagrant+Symfony application

I know you can open files from Symfony profiler or exception file links using this in project/app/config.yml :
framework:
ide: "phpstorm://open?file=%%f&line=%%l"
More info: http://developer.happyr.com/open-files-in-phpstorm-from-you-symfony-application
However as I'm using vagrant, the file path of the server doesn't match my host.
I have created a PHP web application server in PHPStorm with the propper path mappings, but still doesn't work.
Any ideas?
Thanks
When running your app in a container or in a virtual machine, you can tell Symfony to map files from the guest to the host by changing their prefix. This map should be specified at the end of the URL template, using & and > as guest-to-host separators:
// /path/to/guest/.../file will be opened
// as /path/to/host/.../file on the host
// as /path/to/host/.../file on the host
'phpstorm://%f:%l&/path/to/guest/>/path/to/host/&/foo/>/bar/&...'
Symfony FrameworkBundle Configuration - IDE
The answer given by Jeffry no longer works unfortunately :(. When In configure that with my paths the profiler throws:
ParameterNotFoundException
You have requested a non-existent parameter "f:".
I have configured the path according to this line in the SF docs: This map should be specified at the end of the URL template, which results in this:
phpstorm://open?url=file://%%f&line=%%l&/path/to/guest/>/path/to/host/
However, it does open PHPStorm, but phpstorm does not open the file, so i'm a bit stuck here now.
This solves the issue with the file not opening in PhpStorm from a Vagrant:
phpstorm://open?file=%%f&line=%%l&/path/to/guest/>/path/to/host/
Source: https://youtrack.jetbrains.com/issue/IDEA-65879

Google App Engine modules: routing second module to subdirectory

Has anyone run two different WordPress installations as separate modules inside Google App Engine?
I have the following:
/app/
- wordpress1
- wordpress2
- app.yaml
- second.yaml
- dispatch.yaml
- php.ini
Inside wordpress1 and wordpress2 are somewhat clean installations of WordPress, with some GAE helper plugins.
app.yaml contains the default module config, which redirects traffic to wordpress1 using URL handlers.
second.yaml contains the second module config (module: second) and redirects traffic to wordpress2.
In dispatch.yaml I only check for a subdir second to load the second.yaml config:
dispatch:
- url: "*/second*"
module: second
Everything is fine and dandy:
http://localhost.dev:8080 -> wordpress1/index.php
http://localhost.dev:8080/second/ -> wordpress2/index.php
But I can't seem to work out how to set the edge cases:
http://localhost.dev:8080/secondwithextra -> dispatcher error (no URL set)
http://localhost.dev:8080/second (missing trailing slash) -> same as above
I tried to add the following to second.yaml handlers:
- url: /second[^/].+/?
script: wordpress1/index.php # Reroute to `wordpress1` because not a directory match.
But that didn't really work out.
How can I make the second module accept request URI /second, /second/, /second/abc but not /secondxyz?
Having the dispatch.yaml URL glob set to */second/* breaks the slashless /second.
I think you could try to add both */second/* and /second in dispatch.yaml.

Symfony2 CRUD routing Failed

After executing the following command for CRUD generation:
php app/console generate:doctrine:crud --entity=AcmeDemoBundle:Users --format=yml
i get error for automatic routing update by CRUD for each entity.
Confirm automatic update of the Routing [yes]? yes
Importing the CRUD routes: FAILED
The command was not able to configure everything automatically.
You must do the following changes manually.
- Import the bundle's routing resource in the bundle routing file
(C:\wamp\www\symfony\src\Acme\DemoBundle/Resources/config/routing.yml).
AcmeDemoBundle_categories:
resource: "#AcmeDemoBundle/Resources/config/routing/categories.yml"
prefix: /categories
I also tried creating a new bundle but still gets same error. So everytime i add the above code in routing file /src/Acme/DemoBundle/Resources/config/routing.yml
Can someone please suggest what i am missing?
I get the same thing, not sure how to get the generation to work right but it wants you to add that code to your main routing.yml file so it can link the generated routes:
AcmeDemoBundle_categories:
resource: "#AcmeDemoBundle/Resources/config/routing/categories.yml"
prefix: /categories

Resources