LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 02-04-2023, 09:44 AM   #1
Shaggy1
Member
 
Registered: Oct 2010
Posts: 111

Rep: Reputation: 3
How does centos httpd configuration map on to ubuntu apache2 config ?


system info:
Code:
$ uname -a
Linux larrycotton-Latitude-E7440 5.15.0-58-generic #64~20.04.1-Ubuntu SMP Fri Jan 6 16:42:31 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

$ cat /etc/os-release 
NAME="Ubuntu"
VERSION="20.04.5 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.5 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

$ apache2 -v
Server version: Apache/2.4.41 (Ubuntu)
Server built:   2023-01-23T18:36:09
Hi

I have an apache server configuration which I have used on centos httpd - some of which I would like to transfer accross to Ubuntu apache2. I have installed and run up a vanilla apache2 and that seems to be running fine, but I noticed the configuration structure seems to be a little different and was wondering if someone could answer some questions regarding how I can configure it (specifically to use ssl and wsgi).

1) It looks like to install the wsgi module I do:
Code:
$ apt-get install libapache2-mod-wsgi
When I do this I notice it installs libpython2.7 even though the default system python is 3.8. Is that because mod_wsgi is built with python 2.7 and I have to use python 2 with it ?
If so is it possible to get a version of mod_wsgi that is built against python 3.8 ? Or would I have to build that myself ?

2) It looks like in order to load a module you need to put the load statement in a file called <modname>.load in the mods-available directory. Is that correct ?

3) In my httpd config I configure my https parameters, both global and for VirtualHosts in conf.d/ssl.conf. Does anyone know what the equivalent file is for apache2 on Ubuntu ? I see there is an ssl.conf in mods-available and mods-enabled. It looks like apache2.conf includes mods-enabled and mods-enabled simply contains links to mods-available, so can I simply transfer across my httpd ssl.conf to mods-available/ssl.conf (except see Q4 below), or is different syntax required?

4) In my ssl.conf I breate a VirtualHost something like:
Listen 8443
<VirtualHost *:8443>
I notice that on Ubuntu apacher2 there is a file called ports.conf that contains Listen ports for modules. Do I need to put Listen statements for VirtualHost ports in that file ?
 
Old 02-04-2023, 05:25 PM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

modules live in /etc/apache2/mods-available and are loaded if there is a link to them in /etc/apache2/mods-enabled. You can handle the links manually but it is "better" to use the a2enmod and a2dismod. Note there are also a2enconf, a2disconf, a2ensite,... commands and related directories.

Evo2.
 
Old 02-12-2023, 06:36 AM   #3
Shaggy1
Member
 
Registered: Oct 2010
Posts: 111

Original Poster
Rep: Reputation: 3
Thank you for your reply and your pointers to the helper scripts.

It looks like the Listen directive for the virtual host works fine when placed in ssl.conf.

My basic "Hello world" setup now seems to be working (at least locally).

Thank you again for your help
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Failed at step EXEC spawning /usr/local/apache2/bin/apachectl: Permission denied while starting httpd using command "systemctl start httpd" linuxtale Linux - Server 4 06-29-2019 09:39 PM
httpd.pid does not create at the time of starting the httpd hkabir269 Linux - Newbie 3 07-12-2017 06:26 PM
RHEL 6 - Why makedbbm for NIS Server does not create <map>.dir and <map>.pag adeathd Linux - Networking 1 09-17-2015 10:36 AM
httpd: Syntax error on line 210 of /etc/httpd/conf/httpd.conf: Syntax error on line 6 iswarya Linux - Newbie 1 01-25-2012 01:28 PM
Starting httpd: httpd: Syntax error on line 209 of /etc/httpd/conf/httpd.conf: Syntax sethukpathi Linux - Networking 6 04-12-2008 11:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 04:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration