Lost httpd.conf file located apache
Get the path of running Apache
$ ps -ef | grep apache
apache 12846 14590 0 Oct20 ? 00:00:00 /usr/sbin/apache2
Append -V
argument to the path
$ /usr/sbin/apache2 -V | grep SERVER_CONFIG_FILE
-D SERVER_CONFIG_FILE="/etc/apache2/apache2.conf"
Reference:
http://commanigy.com/blog/2011/6/8/finding-apache-configuration-file-httpd-conf-location
Missing LetsEncrypt httpd-prefix.conf File
The file you need is one of the standard Bitnami configuration files, described in their documentation:
The httpd-prefix.conf file ships the default configuration for the
applications in “prefix” mode, such that the application can be accessed
at (for example) http://example.com/myapp.Alias /myapp/ "/opt/bitnami/apps/myapp/htdocs/"
Alias /myapp "/opt/bitnami/apps/myapp/htdocs"
Include "/opt/bitnami/apps/myapp/conf/httpd-app.conf"
You can reconstruct the file from your existing configuration. The httpd-app.conf, if you have lost it also, contains the location and access of the website:
<Directory "/opt/bitnami/apps/myapp/htdocs">
Options +MultiViews
AllowOverride None
<IfVersion < 2.3 >
Order allow,deny
Allow from all
</IfVersion>
<IfVersion >= 2.3>
Require all granted
</IfVersion>
</Directory>
Include /opt/bitnami/apps/myapp/conf/htaccess.conf
and for a public website, I'd think htaccess would be likely empty, so you can even comment that line out.
If you have other sites on that machine, you can check their config to have an idea of how to rebuild the missing one. I've done this many times.
As a last resort, recreate an empty site from a Bitnami image of the same version, using the same parameters. You needn't install it for real. Just grab the Apache configuration files, then use them as a template for your installation.
Otherwise, but this is gross butchery, you can try recovering the configuration from the running Apache instance using this answer on ServerFault. You will then have to grep the resulting file to locate the missing parts, and store them in the appropriate files. If you go down this road, be aware that it is a mess.
Related Topics
How to Get the Bssid of Currently Connected Network Through Bash
How to Grep For Contents After Pattern
How to Merge Two "Ar" Static Libraries into One
What Is Rss and Vsz in Linux Memory Management
Using Awk to Print All Columns from the Nth to the Last
Tool to Trace Local Function Calls in Linux
Bash Script Process Substitution Syntax Error: "(" Unexpected
Bash Function to Find Newest File Matching Pattern
What Is the Maximum Size of a Linux Environment Variable Value
Minimal Executable Size Now 10X Larger After Linking Than 2 Years Ago, For Tiny Programs
Error:13 - Permission Denied Android Studio
Can You Run Gui Applications in a Linux Docker Container
How Does "Cat ≪≪ Eof" Work in Bash
Understanding Linux /Proc/Pid/Maps or /Proc/Self/Maps
How to Install Latest Version of Git on Centos 8.X/7.X/6.X
More Elegant "Ps Aux | Grep -V Grep"
Quickly Create a Large File on a Linux System
Bluetooth Low Energy: Listening For Notifications/Indications in Linux