Symfony2 Environment Configuration - symfony

I have a Symfony2 application with JS+PHP files that should access
"http://localhost/blahblah"
when on my development machine, but
"http://mydomain.com/blahblah"
when I push them to the production server. What's the appropriate way to configure these domains in Symfony2, to avoid manually changing the files with each server push?

I think the better is create a virtual host in your local machine and add these hosts mydomain.com/blahblah www.mydomain.com
In your host file, in linux are in /etc/hosts windows system32\drivers\etc\hosts ( i guess )
When you want to see production site you can comment those lines in your host file

Related

I need to run a file that I placed on an AWS server using sftp

I have a bitnami WordPress instance using AWS lightsail. I need to migrate the site to another identical AWS instance. I created a PHP installer from the first instance using the Wordpress Duplicator plugin.
I then uploaded the file onto the new server to a folder (opt/bitnami/apache2/htdocs/).The instructions I've seen online they say I just need to navigate to the location of the installer in a browser and it will run. However, when I attempt to access the PHP file from a browser I just get an error on the front-end saying:
OOPS! THAT PAGE CAN’T BE FOUND
I have seen suggestions online that the installer be placed into a public folder called html_public but my instance doesn't have a folder like that. I changed the access rights to the folder, and the installer, to be full rw access.
Any ideas how I can get this to work?
You must config the Security Groups firewall to open the HTTP port.
Open the Amazon VPC console at [https://console.aws.amazon.com/vpc/]
On the Inbound Rules tab, choose Edit the port range 80, 443 - Source: Anywhere - IP Address: 0.0.0.0/0 and Save.

How to move wordpress website with ssl on localhost?

Website with ssl on wordpress. Moved it on localhost, changed wp-config, changed https://olddomain.ru to http://newdomain.ru.
But still have error ERR_SSL_PROTOCOL_ERROR in browser and Invalid method in request \x16\x03\x01 in apache2 logs.Trying to start it via MAMP. How to disable SSL?
This question relates to current and previous MAMP and MAMP PRO versions. MAMP PRO assists in replicating basic web host production environment on a users local Windows based system.
First, it's best to isolate the problem by disconnecting your system from internet.
Turning off GroupStart for Apache and MySQL by un-checking "Include MySQL in GroupStart" is another isolation problem solving technique:
https://documentation.mamp.info/en/MAMP-PRO-Windows/Servers-and-Services/Apache/
https://documentation.mamp.info/en/MAMP-PRO-Windows/Servers-and-Services/MySQL/
Emptying logs by erasing the log files prior to trying out the steps below is another way to isolate problems:
C:\MAMP\logs
Most local systems have AntiVirus program and the antivirus program usually has software firewall bundled. Be sure to add Web Server and HTTPS ports under ports and services of your choice of AntiVirus software.
1. Custom Domain:
First issue is related to assigning custom domains. A custom domain is assigned by modifying Windows Hosts file to point localhost host with IP 127.0.0.1 to a fictitious domain name.
Here is how the default hosts file looks like:
https://support.microsoft.com/en-us/help/972034/how-to-reset-the-hosts-file-back-to-the-default
Here is the required modification:
hosts file
127.0.0.1 newdomain.ru
::0 localhost
::0 is the bus/port designation of a systems network adapter. Usually the first available network adapter software on a device has ::0 address.
After modifying hosts file be sure to flush dns by using Windows command prompt:
ipconfig /flushdns
2. Location of Virtual Hosts data
MAMP documentation recommends you store virtual Hosts data outside of default C:\MAMP\htdocs directory.
https://documentation.mamp.info/en/MAMP-PRO-Windows/First-Steps/View-Localhost/
3. Serverside language application
MAMP recommends to serve serverside language applications such as WordPress on port 80 in your local development environment.
https://documentation.mamp.info/en/MAMP-PRO-Windows/Troubleshooting/WordPress/WordPress1/

Why my webservice runs in localhost but doesn't run in my host on the internet?

I wrote a simple web service and published it, then upload it in my host. There is a folder with name "webservice1" in my host, beside other files of my web site.
In folder "webservice1" I upload 2 files: myclass_Service1.asmx and web.config and a folder bin which has dll files.
But when I type the address of my webservice in the URL, it isn't recognized.
I also upload files in root of my host, but they also aren't recognized.
In my local host it will run, but on my host it doesn't
Why?
thanks
What exactly does your Browser say?
Sounds like a Firewall issue to me:
Open the "Windows Firewall with Advanced Security"
Choose the "Inbound Rules"
Search for Rules including "WWW-Services" or Similar
Make sure to Activate the Rules allowing Port 80 (and 443 for https)
Screenshot (Sorry for german):
Windows Firewall

Pointing my domain from godaddy to ec2 Ubuntu wordpress

Please how do I point my domain directly to the paajoe directory ? When I enter paajoe.com I see this two directory but I want to go directly to the paajoe directory.
This would require an update to your web server configuration which would differ depending on which web server you are using. Typically, it'll be Apache or NGINX.
If Apache, you need to update the DocumentRoot and Directory values within your configuration file while would typically live in /etc/apache2/sites-available/.
If NGINX, you need to update the root value within your configuration file which would typically live in /etc/nginx/sites-available/.
Here are a couple of links which would help in either situation:
https://www.digitalocean.com/community/tutorials/how-to-move-an-nginx-web-root-to-a-new-location-on-ubuntu-16-04
https://www.digitalocean.com/community/tutorials/how-to-move-an-apache-web-root-to-a-new-location-on-ubuntu-16-04

Publishing and Configuring ASP.NET site in internet

there!
I'm now publishing asp.net site on test server. I have added it in IIS ( v6.0). I have created for it alias like test.inventory.site.com. On it exists MS Windows Server 2003.
Also I have access to production server. For both servers I connect through Remote Desktop. And to prod. server I connect with address like inventory.site.com, to test server connection address is inventory.site.com:port. I need access through internet to my test site by it's name test.inventory.site.com. On production server exist several sites, therefore it doesn't work when I create alias for production server ip in my local hosts file.
How I can configure it?
You can edit your local dns server or on the development box edit the hosts file located in c:\windodws\system32\drivers\etc
You can change the IP address for the host names so that you can point them to your development or live.
The hosts file will just change the address for the site on your local computer.

Resources