PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, May 15, 2022

[FIXED] How to perform Apache 2 config migration from Linux SUSE to Ubuntu?

 May 15, 2022     apache, apache2, linux, suse, ubuntu     No comments   

Issue

I'm a newbie with Apache configurations. I need to migrate a web tool running on Linux SUSE with Apache 2 to Ubuntu. It is currently using an external httpd.conf located in some other place on the machine, set as APACHE_HTTPD_CONF variable in /etc/sysconfig/apache2. It looks like there is no /etc/sysconfig/apache2, and also no APACHE_HTTPD_CONF variable in any of the files in /etc/apache2/ on Ubuntu. How can I configure it correctly?


Solution

In ubuntu, at /etc/apache2 you have the possibility to config several criteria of things, such as:

  • conf
  • mods
  • sites

These have a folder of -available (sites-available, for example) and a folder of -enabled (sites-enabled, for example). You will definitely need to define your sitename.conf file in sites-available and then run

sudo a2ensite sitename

to enable it. Similarly, you will need to enable mods and conf. Whenever you performed some large change and intend to test or use Apache, restart it:

sudo service apache2 restart

There is also an apache2.conf file for general Apache settings.

In your scenario I would recommend copying the content of your httpd.conf into /etc/apache2/sites-available/sitename.conf and then run

sudo a2ensite sitename
sudo service apache2 restart

This copies the config file from /etc/apache2/sites-available to /etc/apache2/sites-enabled and restarts Apache. You will also need to edit /etc/hosts to define your sitename to be loaded from 127.0.0.1.



Answered By - Lajos Arpad
Answer Checked By - Pedro (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing