How to restore Apache configuration file in Bitnami - wordpress

When running the bncert-tool on my LightSail server, I have accidentally modified some of Apache's configuration files which I now need to revert from the backup directories.
See previous question and answer here for more info: Modified Bncert command has taken site offline
I have looked in both the /opt/bitnami/apache2/conf and /opt/bitnami/apache2/conf/bitnami directories and can see a series of files including httpd.conf.back.202101220056 (/conf) and bitnami.conf.back.202101220056 (/bitnami).
My question is which backup files do I need need to copy to which location?
I assume it is performed via a 'mv' command.
Many thanks for your help.

On a bitnami stack the main Apache server configuration file is (httpd.conf)
When you are configuring server for SSL this is usually done in the file (bitnami.conf)
I would start by replacing the current bitnami.conf with the original bitnami.conf. Then restart your server so that the changes that effect. bitnami.conf is located in the directory apache2/conf/bitnami
If that does not fix it then replace the current httpd.conf with the original httpd.conf. Then restart your server so that the changes that effect. httpd.conf is located in the directory apache2/conf .
Note you will find it a lot easier to modify server files if you connect to your server with FileZilla. You can delete and drag and drop to copy files with FileZilla.

Related

Wordpress on Nginx server - .htaccess vs. nginx.conf

I have recently changed from Apache to Nginx server and running a Wordpress installation that was migrated onto this new Nginx server.
I only just realised that (the server provider forgot to mention) that the .htaccess file is no longer supported and shouldn't be used with Nginx.
Instead the nginx.conf file should be used. I know I can convert the contents of my current .htaccess file to nginx.conf using one of the convertors, but I don't even have the nginx.conf file.
Can I just create one?? And If I create one, do I place it into the root where currently my .htaccess file is??
Do I then delete the existing .htaccess file?
How should I go about this?
You definitely have nginx.conf - without it, your site wouldn't work. It is in /etc/nginx/ folder, and some additional configs can exist there and in subfolders.
Standard recommendations for WordPress with nginx you can find here in Codex. But if your site works, you have nothing else to do.
Unlike Apache with .htaccess files, nginx does not use any configuration files in WordPress folders. Everything is centralized in /etc/nginx/.
.htaccess files are ignored by nginx and can be deleted or kept in WordPress folders - it doesn't matter.
However, if you have some non-standard tuning in .htaccess files, you should implement relevant directives in nginx conf files. Convertors not very good for it, and produce errors sometimes, unfortunately. You should learn Apache rules used and create similar for nginx by yourself.

Nginx fails to create directories on Windows 10 with error: nginx: CreateFile()...failed

I need to find a way/setting to allow Nginx to run a .bat file that will create directories and files via a WINDOWS service; my OS is Windows 10.
Currently, our windows service fails to create directories and files with the following:
CreateFile()
"C:\someForlderName\build\distribution.\nginx/logs/error.log" failed
(3: The system cannot find the path specified)
Somehow Nginx doesn't have enough permissions to perform write-access operations like creating directories such as /logs/ and /temp/ within the /Nginx/ directory.
Anybody ran into this problem before?
I was facing the same problem, sharing the thing that worked for me.
Nginx is showing this error because... nginx didn't find the error.log file..
For that,
Go to you nginx folder where other folders like conf, docs, html etc are their as.
Create folder name logs, and in that folder create a file name error.logas.
see the right way in picture..
If your Nginx is at D:\nginx\nginx.exe, execute this to start nginx
D:\nginx\nginx.exe -c D:\nginx\conf\nginx.conf -p D:\nginx\
For Nginx on Windows, you need to execute nginx server related command from respective home directory where nginx configuration file is located.

Change the Wordpress URL

I would like to change the URL for my Wordpress:
From this: www.example.com/wordpress
To this: www.example.com/game
What do I need to do?
I tried renaming the Wordpress folder to game but this did not work. It caused a linkage problem with the bank-end database.
which server you are using.
if you are using apache or nginx you need to modify you vhost files accordingly to point to the right directory.
location of these file depend on you server's OS.
commonly it is in /etc/httpd/conf.d/ or /etc/apache2/conf.d/
Not open any file in this www.example.com/wordpress folder, Change permission this folder apply 755 permission, stop apache server or stop xampp. after rename your foder name and start apache server or xammp

Migrating Drupal

Currently I have a single drupal site installed on apache 2.2 with php 5.3 on RHEL 6. I am moving servers and am trying to migrate the site. I have imported the database and htaccess, but I cannot access any of the pages other than the root of the site.
You may need to disable clean URLs before exporting the database, try to add ?q= before each path.
That happens when:
a) Apache mod_rewrite is not enabled. If you have root access then do sudo a2enmod rewrite
or
b) .htaccess file at the root folder isn't there, so you need to copy it again.
Here's a troubleshoot check list for mod_rewrite issues:
Make sure Apache's rewrite module is enabled: sudo a2enmod rewrite.
Make sure original .htaccess file is there in the root of your Drupal installation.
Make sure that the existing .htaccess file is getting read by Apache. To test it, add a this line in the beginning of the file and you should get a 500 Internal Server Error: ThisIsReallyABadSyntax.
If the .htaccess file is not in effect, make sure that the AllowOverride directive in the main Apache config file (usually /etc/apache2/httpd.conf on debian-based distros) is set to All. It might be set to None by default.
Finally, make sure that the clean URLs feature is enabled in Drupal settings.
With the phpinfo(); compare all the server specs, just to be sure both server are quite the same or similar.
Steps to migrate Drupal correctly:
Go to Configuration
find Clean URLs
Disable tick inside!
Clean cache!
Download your site file
Download your database
Create new database in your new site
Transfer file and database
Log in
10.Do this step to enable Clean URLs:
It's work 100% guaranteed !
Steps:
1. Download - Dev version (7.x-dev)
2. Find file .htaccess
3. just copy it to your server
4. That's it !

Change the path of a symlinked directory in NGINX

Lets say that I have a directory /var/www/assets/ and within that directory I have a symlink which points to a folder which contains all the latest asset files for my website.
/var/www/assets/asssets -> /var/www/website/releases/xxxxxxx/public/assets
If I configure NGINX to serve asset files from /var/www/assets with the domain assetfilesdomain.com and asset files are prefixed with the directory /asset/ then when that /asset folder's symlink is changed then the updated link is not reflected in NGINX. The way that I see it, NGINX grabs the resolved path for that asset folder when it is started.
Is there any way to get around this?
Reloading nginx (sending a HUP signal to the master process) seems to solve this issue (probably because it starts new workers and shuts down the old ones, gracefully).
it seems like you're using Capistrano. You can override deploy:restart and put the nginx reloading there.

Resources