How to install a custom certificate in Symfony server? - symfony

With server:ca:install on the Symfony console an SSL certificate can be generated and installed.
Is it possible / How to install an existing one, created separately (instead of the auto-generated one)?
Background: I need a certificate, that contains a specific IP as "alternative name".

symfony server:ca:install command creates and install certificates in user home directory (~) under .symfony5/certs folder you can replace generated certs with the existing ones here.
Note: Before replacing you can backup existing certs for later usage Or you can just regenerate new certs with the same command.

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.

Set up a domain name to point to the host you're installing on

I am installing phabricator following this guide. Step I am having hard time with is
set up a domain name to point to the host you're installing on. You can either install Phabricator on a subdomain (like phabricator.example.com)
I am installing it in virtual box and I am not sure if I have to have a valid domain (bought?) or if I can set it up only locally which I need, I am supposed to only test the Phabricator functions.
If you're only testing locally, you can set up a test domain name in your /etc/hosts file (C:\Windows\System32\Drivers\etc\hosts for Windows clients). Usually you will use something like phabricator.local to avoid conflicting with real domains, but a subdomain that you or your organization owns is also an option.

How to install a SSL Certificate for a Wordpress website hosted in a Google Cloud Platform instance?

I just received a zip file containing the mydomain.crt and mydomain.ca-bundle files. I would like to know how to install the certificate for a WordPress website hosted in a Google Cloud Platform instance. I have the instance configured with the common Bitnami software ( Apache 2.4.25, MySQL 5.7.18, OpenSSL 1.0.2k, PHP 7.0.18, phpMyAdmin 4.7.0, SQLite 3.7.15.1, Varnish 4.1.0, WordPress 4.8). I found plugins available from WordPress such as Really Simple SSL or Cloudflare, but I would like to avoid the use of plugins. Thanks.
You want to follow apache instructions on installing SSL cert onto your website. Meaning, you will need to install the certificate by generating the keys and restarting your server. Being on the cloud or being on a hosted server that's not on the cloud shouldn't matter, it's a web server although you have to make sure port :443 is in your security firewall is allowed otherwise you're https request will change.
Once you've done that, and the installation is successful, you should see a lock next to the https request with the domain information you gave when you installed the ssl certificate. Let us know what kind of problems you ran into, otherwise you should be good to go. You may need to change all your referencing urls that is http to https with mysql search and replace query afterwards.
I found all the required information in this page Bitnami WordPress for Google Cloud Platform. Once you have your certificate generated (self-signed or from an official Certificate Authority), which usually contains 2 files (yourdomian.crt and yourdomian.ca-bundle), the simplest procedure is:
Upload those two files to /opt/bitnami/apache2/conf
If it is a fresh install, in that folder you should have the server.key, server.crt and server-ca.crt original files. Make a backup of them and delete them, or just rename them like server_b.key, server_b.crt and server-ca_b.crt
Rename yourdomian.crt to server.crt and yourdomian.ca-bundle to server-ca.crt
In the same folder /opt/bitnami/apache2/conf place a copy of the key used to generate the certificate signing request (CSR), and rename the key to server.key
Open the configuration file with sudo nano/opt/bitnami/apache2/conf/bitnami/bitnami.conf if you are not root.
To the section add SSLCACertificateFile "/opt/bitnami/apache2/conf/server-ca.crt" if using Apache v2.4.8+, or SSLCertificateChainFile "/opt/bitnami/apache2/conf/server-ca.crt" if using Apache < v2.4.8 and save the changes
Make your files only readable by root with sudo chown root:root /opt/bitnami/apache2/conf/server* and sudo chmod 600 /opt/bitnami/apache2/conf/server*
Restart apache with sudo /opt/bitnami/ctlscript.sh restart apache
That worked for me to have a Certificate Authority (CA) produced SSL certificate working for my WordPress site, hosted in a Google Cloud VM without installing any third party plugins. As #unixmiah pointed out, do not forget to open port 443 in the server firewall.

Symfony setup directory on cloudways

I want to set up symfony3 on cloudways. Path for application folder is /home/master/applications/[appName]. pwd in this dir: conf logs private_html public_html ssl tmp.
As this link says I should install symfony application in public_html. However, I know that public_html is the same as web. So an application should not live in that folder. So, I think to install folder directly in /home/master/applications/[appName] and change 'web' directory to public_html. Is that right? Do not other existing folders (conf, logs) interfere symfony app?
Update: I am going to setup a git repo for symfony app on server. So if symfony should be installed in public_html/../ then all other files also will be tracked by git. I do not think that ssl should be tracked. Sure, I can add it to gitignore, but anyway.
I am from cloudways. Let me tell you the whole process, Cloudways is a managed hosting so there are some restrictions. You can't install symfony in: /home/master/applications/[appName]. You need to move in Public_html which is not a typical public directory. Install Symfony in this folder and don't worry your other files are not exposed beside the web folder. Every file is securely hidden and the whole process is also tested by Symfony officials.
After installing symfony in public_html folder, you can point out the URL to web directory:
Again nobody will have access to your files they are protected.
You can add .gitignore file to avoid unusual files to be tracked. I created some tutorials you can take guidance from them. here is the URL: https://www.cloudways.com/blog/php/symfony/.
The web directory is the directory Symfony is served out of via the frontend controller app.php (or app_{env}.php for non-prod). This is separate in philosophy from where your web server serves from (apache, nginx, etc). The directory structure ultimately doesn't matter much in either case so long as you point your web server to the correct directory where your frontend controller lives.
This is a good starting point: http://symfony.com/doc/current/setup/web_server_configuration.html

How to get SSL using Let's Encrypt! when my hostname is hosted by wordpress?

I have a site www.testsite.com that is hosted by wordpress.com, I'm trying to issue a certificate so I can have https.
Is there any good methods to use when I cannot really install letsEncrypt's ACME client on my wordpress.com's account?
One way to issue your certificate for your wordpress (and actually, for any other website type), is to install (clone) Let's encrypt to your machine.
The main and very basic idea is that Let's Encrypt (LE) wants you to prove that you do have access control to your domain. This is achieved through a challenge. You have to output a string they provide you inside a folder. For example, at yourwordpress.com/.well-known/acme-challenge/
the (LE) authority wants to read a long string it provides you.
So, inside your wordpress site folder, create those directories.
Once this is successfully checked, LE, saves your ssl certificates in your local machine with root privileges.
Now you have to upload those certificates *.pem to your server. This last step is different depending on the company server.
Here is a nice tutorial that worked for me to get the LE certificates.

Resources