LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-22-2020, 10:19 PM   #16
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,269
Blog Entries: 24

Rep: Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206

That is nice, but none of that answers any of the questions asked, it redefines and confuses the problem.

That is too much of a moving target for me to try to follow.

You are still asking about path aliases not working, but you have also mentioned that virtual hosts and PHP are not working... it is not possible for anyone here to understand what the actual problem(s) might be from the descriptions posted here.

I would suggest that you approach the problem systematically, from the ground up.

1. Get the web server working with a simple document root path and a simple HTML test page...
2. When that is working reliably, add your virtual host(s) and verify they resolve correctly...
3. Enable PHP in the desired virtual host(s) and verify that it works as expected...
4. Add an Alias directive, verify it does not break anything previously working, and works as expected...

When you get stuck at some point return to ask for help with a clear description of what does and does not work and post only the relevant portions of your config files in line here. (Note: Posting your complete configs to PasteBin is not a very good option for yourself or for those offering help. Doing so allows you to skip identifying and extracting only the relevant parts which is the best troubleshooting exercise for you, and asking others to read your complete configs and troubleshoot them for you is not how LQ works.)

Try that and see if you can reach a better defined condition - or maybe solve all the problems in the process, which is the best outcome!
 
Old 10-22-2020, 11:11 PM   #17
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
Quote:
Originally Posted by TBotNik View Post
astrogeek,

I went to "fstabs" and entered the 3 TB drive so now on boot it mounts as just "3T". Now my aliases.comf file reads for one new link:



Which should assign the declared directory to "localhost/WRU" in the browser, but it is not and also not rendering any of the .PHP files, which is declared in the /etc/apache2/apache.conr file.

Not really sure what you are asking, but that is my understanding of an alias!

Cheers!

TBNK
It has been years since I managed a web server, but I think you need to read and understand exactly how aliases work on a web server. With apache each alias gets its own directory tree, usually under /var/www, and it has to be properly configured in the apache config for the path used for that web sites files, complete with hostname used, etc.
The directory? localhost/WRU possibly has no real meaning to the web server since localhost is a defined name for that machine on the 127.0.0.1 address, and apache does not (if configured properly) listen to that IP.

Dig a bit deeper in how to configure apache, the directory structures to use for the aliased hosts on that web server, permissions needed, and then set it up properly. For security purposes apache is almost never allowed to serve public web pages from any part of the directory tree outside of /var/www (or /www on some systems) if the server is accessible from the internet.

The main config directory for httpd on my system is /etc/httpd/conf and the man page for the config file is "man httpd.conf". Both /etc/httpd/conf/httpd.conf and the man page for that file have a lot of detailed info on how to set things up, complete with examples, so read up and follow the directions.

With your lack of understanding about mounting a filesystem and the problems you encountered there I think it likely you need to take things slow and try to fully understand things before you really open up a major security hole on your system. Studying a little will help you ask better questions as well, instead of needing us to hold your hand for every step of the way.

If you need more reference material Oreilly has at least a dozen books about web servers, and I think a good start would be the one titled Apache.

Last edited by computersavvy; 10-22-2020 at 11:26 PM.
 
Old 11-06-2020, 02:22 PM   #18
TBotNik
Member
 
Registered: May 2016
Location: Greenville, TX
Distribution: Kubuntu 18.04
Posts: 796

Original Poster
Rep: Reputation: Disabled
Multiple sites

All,

All the Apache docs say that multiple drives, mul6tiple sites, multiple aliases are supported, so since I've exhausted myself following multiple HOWTOs that say "It WOrks", I've posted my 4 files in the pastebin at:

https://pastebin.com/kXrKpXAt

So y'all can help me diagnose what is wrong!

I set the mount point in fstabs, for my secondary 3T drive to "/3T" and using that in the defs!

Cheers!

TBNK
 
Old 12-14-2020, 10:10 AM   #19
TBotNik
Member
 
Registered: May 2016
Location: Greenville, TX
Distribution: Kubuntu 18.04
Posts: 796

Original Poster
Rep: Reputation: Disabled
All,

Still do not have Apache working right. I'm not good at Virtual Hosts and think that is where the problem lies as I need to still have "localhost" in /var/www (not /var/www/html) and then need to access the /3T drive as a seperate Virtual host, so reading up on that and hope to get it working soon.

Any shortcuts you know to help with this would be great right now and much appreciated!

Cheers!

TBNK
 
Old 01-01-2021, 01:32 PM   #20
TBotNik
Member
 
Registered: May 2016
Location: Greenville, TX
Distribution: Kubuntu 18.04
Posts: 796

Original Poster
Rep: Reputation: Disabled
Current Errors!

All,

Nothing is added to the apache error log, but getting this error msg, when I start apache:

Quote:
service apache2 start
Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details.
Not sure what this means! Submitted to Google and then ran cmd:

systemctl status apache2.service

Getting errors of:

Quote:
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: failed (Result: exit-code) since Fri 2021-01-01 08:36:46 CST; 4h 4min ago
Process: 25769 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)

Jan 01 08:36:46 TBNK-SVR systemd[1]: Starting The Apache HTTP Server...
Jan 01 08:36:46 TBNK-SVR apachectl[25769]: apache2: Syntax error on line 53 of /etc/apache2/apache2.conf: Syntax error on line 7 of /etc/apache2/sites-enabled/000-default.conf: Expected </Directory/> but saw </Directory>
Jan 01 08:36:46 TBNK-SVR apachectl[25769]: Action 'start' failed.
Jan 01 08:36:46 TBNK-SVR apachectl[25769]: The Apache error log may have more information.
Jan 01 08:36:46 TBNK-SVR systemd[1]: apache2.service: Control process exited, code=exited status=1
Jan 01 08:36:46 TBNK-SVR systemd[1]: apache2.service: Failed with result 'exit-code'.
Jan 01 08:36:46 TBNK-SVR systemd[1]: Failed to start The Apache HTTP Server.
Edited the 2 erroring files; then restarted! Took me 3 tries to clear all the errors, but now apache is working as well as the 2 virtual hosts I declared, but my aliases still are finding the /3T drive.

Nor does PHPmyAdmin come up!

Cheers!

TBNK

Last edited by TBotNik; 01-01-2021 at 01:36 PM.
 
Old 01-01-2021, 02:21 PM   #21
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
Quote:
Originally Posted by TBotNik View Post

Edited the 2 erroring files; then restarted! Took me 3 tries to clear all the errors, but now apache is working as well as the 2 virtual hosts I declared, but my aliases still are finding the /3T drive.

Nor does PHPmyAdmin come up!

Cheers!

TBNK
Simple.
Keep working on the config, and focus on only one problem at a time.
The files in /etc/httpd/conf.d (which should be where you have the config files for the aliases) need to be reset so each alias has the proper path to its home directories. Once that is fixed then worry about PHPmyAdmin last.

Remember that each time you make a change in an config file for httpd, you need to restart httpd before the change takes affect.
 
Old 01-02-2021, 01:15 PM   #22
TBotNik
Member
 
Registered: May 2016
Location: Greenville, TX
Distribution: Kubuntu 18.04
Posts: 796

Original Poster
Rep: Reputation: Disabled
All,

All the virtual hosts are showing the localhost index.html file!

Still reading to find out why they are not showing their own index.html files.

Cheers!

TBNK
 
Old 01-02-2021, 01:49 PM   #23
TBotNik
Member
 
Registered: May 2016
Location: Greenville, TX
Distribution: Kubuntu 18.04
Posts: 796

Original Poster
Rep: Reputation: Disabled
All,

I'm following the HOWTO at:

https://www.digitalocean.com/communi...n-ubuntu-18-04

The first virtual host I named projects.com and set up it's conf file, which I put in:

https://pastebin.com/QwjBNw5J

The index.html file for it is at /3T/Syncs/Projects

But still not understanding how to properly direct apache to this directory.

Cheers!
 
Old 01-02-2021, 01:51 PM   #24
TBotNik
Member
 
Registered: May 2016
Location: Greenville, TX
Distribution: Kubuntu 18.04
Posts: 796

Original Poster
Rep: Reputation: Disabled
All,

I've read over 50 howtos on this but still not grasping the correct concept!

TBNK
 
Old 01-02-2021, 02:02 PM   #25
TBotNik
Member
 
Registered: May 2016
Location: Greenville, TX
Distribution: Kubuntu 18.04
Posts: 796

Original Poster
Rep: Reputation: Disabled
index file

All,

The index file for projects.com is:

Quote:
<!-- This is the index.html default home page for projects.com -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Projects.com Default Page: It works</title>
<style type="text/css" media="screen">
* {
margin: 0px 0px 0px 0px;
padding: 0px 0px 0px 0px;
}

body, html {
padding: 3px 3px 3px 3px;

background-color: #D8DBE2;

font-family: Verdana, sans-serif;
font-size: 11pt;
text-align: center;
}

div.main_page {
position: relative;
display: table;

width: 800px;

margin-bottom: 3px;
margin-left: auto;
margin-right: auto;
padding: 0px 0px 0px 0px;

border-width: 2px;
border-color: #212738;
border-style: solid;

background-color: #FFFFFF;

text-align: center;
}

div.page_header {
height: 99px;
width: 100%;

background-color: #F5F6F7;
}

div.page_header span {
margin: 15px 0px 0px 50px;

font-size: 180%;
font-weight: bold;
}

div.page_header img {
margin: 3px 0px 0px 40px;

border: 0px 0px 0px;
}

div.table_of_contents {
clear: left;

min-width: 200px;

margin: 3px 3px 3px 3px;

background-color: #FFFFFF;

text-align: left;
}

div.table_of_contents_item {
clear: left;

width: 100%;

margin: 4px 0px 0px 0px;

background-color: #FFFFFF;

color: #000000;
text-align: left;
}

div.table_of_contents_item a {
margin: 6px 0px 0px 6px;
}

div.content_section {
margin: 3px 3px 3px 3px;

background-color: #FFFFFF;

text-align: left;
}

div.content_section_text {
padding: 4px 8px 4px 8px;

color: #000000;
font-size: 100%;
}

div.content_section_text pre {
margin: 8px 0px 8px 0px;
padding: 8px 8px 8px 8px;

border-width: 1px;
border-style: dotted;
border-color: #000000;

background-color: #F5F6F7;

font-style: italic;
}

div.content_section_text p {
margin-bottom: 6px;
}

div.content_section_text ul, div.content_section_text li {
padding: 4px 8px 4px 16px;
}

div.section_header {
padding: 3px 6px 3px 6px;

background-color: #8E9CB2;

color: #FFFFFF;
font-weight: bold;
font-size: 112%;
text-align: center;
}

div.section_header_red {
background-color: #CD214F;
}

div.section_header_grey {
background-color: #9F9386;
}

.floating_element {
position: relative;
float: left;
}

div.table_of_contents_item a,
div.content_section_text a {
text-decoration: none;
font-weight: bold;
}

div.table_of_contents_item a:link,
div.table_of_contents_item a:visited,
div.table_of_contents_item a:active {
color: #000000;
}

div.table_of_contents_item a:hover {
background-color: #000000;

color: #FFFFFF;
}

div.content_section_text a:link,
div.content_section_text a:visited,
div.content_section_text a:active {
background-color: #DCDFE6;

color: #000000;
}

div.content_section_text a:hover {
background-color: #000000;

color: #DCDFE6;
}

div.validator {
}
</style>
</head>
<body>
<div class="main_page">
<div class="page_header floating_element">
<p>&nbsp;</p>
<h2>Projects.com Default Page</h2>
</div>
<div class="section_header section_header_red">
<div id="about"></div>
It works!
</div>
<div class="content_section_text">
<p>
This page is located at:
<tt>/3T/Syncs/Projects/index.html</tt>
</p>
</div>
<div class="section_header">
<div id="docroot"></div>
Document Root
</div>

<div class="content_section_text">
<p>
This document root is:
<tt>/3T/Syncs/Projects/</tt>
</p>
</div>

<div class="section_header">
<div id="alias"></div>
Aliases
</div>
<div class="content_section_text">
<p>
This Projects.com configuration inclues aliases assignments for:
</p>
<center>
<table width='85%' align='center' border='0'>
<tr>
<td width='20%'><b>Alias</b></td><td width='5%'>&nbsp;</td>
<td><b>Link</b></td>
</tr>
<tr>
<td><b>ADS</b></td><td>=></td>
<td><a href="projects.com/ads">projects.com/ads</a></td>
</tr>
<tr>
<td><b>CL-ADs</b></td><td>=></td>
<td><a href="projects.com/CLA">projects.com/CLA</a></td>
</tr>
<tr>
<td><b>DBOX</b></td><td>=></td>
<td><a href="projects.com/dbox">projects.com/dbox</a></td>
</tr>
<tr>
<td><b>Files</b></td><td>=></td>
<td><a href="projects.com/files">projects.com/files</a></td>
</tr>
<tr>
<td><b>Job-Ads</b></td><td>=></td>
<td><a href="projects.com/job-ads">projects.com/job-ads</a></td>
</tr>
<tr>
<td><b>Ministry</b></td><td>=></td>
<td><a href="projects.com/ministry">projects.com/ministry</a></td>
</tr>
<tr>
<td><b>Manuals</b></td><td>=></td>
<td><a href="projects.com/Manuals">projects.com/Manuals</a></td>
</tr>
<tr>
<td><b>MyStuff</b></td><td>=></td>
<td><a href="projects.com/MyStuff">projects.com/MyStuff</a></td>
</tr>
<tr>
<td><b>Pear</b></td><td>=></td>
<td><a href="projects.com/pear">projects.com/pear</a></td>
</tr>
<tr>
<td><b>PHPmyAdmin</b></td><td>=></td>
<td><a href="projects.com/phpmyadmin">projects.com/phpmyadmin</a></td>
</tr>
<tr>
<td><b>Projects</b></td><td>=></td>
<td><a href="projects.com/projects">projects.com/projects</a></td>
</tr>
<tr>
<td><b>Resumes</b></td><td>=></td>
<td><a href="projects.com/resumes">projects.com/resumes</a></td>
</tr>
<tr>
<td><b>SEO</b></td><td>=></td>
<td><a href="projects.com/SEO">projects.com/SEO</a></td>
</tr>
<tr>
<td><b>SEO_Panel</b></td><td>=></td>
<td><a href="projects.com/SEO_Panel">projects.com/SEO_Panel</a></td>
</tr>
<tr>
<td><b>Symfony</b></td><td>=></td>
<td><a href="projects.com/Symfony">projects.com/Symfony</a></td>
</tr>
<tr>
<td><b>TopicC</b></td><td>=></td>
<td><a href="projects.com/TopicC">projects.com/TopicC</a></td>
</tr>
<tr>
<td><b>Tripod</b></td><td>=></td>
<td><a href="projects.com/tripod">projects.com/tripod</a></td>
</tr>
<tr>
<td><b>WRU</b></td><td>=></td>
<td><a href="projects.com/WRU">projects.com/WRU</a></td>
</tr>
</table>
</center>
</div>
</body>
</html>
All the aliases are incorrect as I originally had the aliases.conf file in the /etc/apache2/conf-available directory and now not sure if I just rename it/copy it or have to put them (now 3) in different directories.

Cheers!

TBNK
 
Old 01-02-2021, 02:35 PM   #26
TBotNik
Member
 
Registered: May 2016
Location: Greenville, TX
Distribution: Kubuntu 18.04
Posts: 796

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by computersavvy View Post
Simple.
Keep working on the config, and focus on only one problem at a time.
The files in /etc/httpd/conf.d (which should be where you have the config files for the aliases) need to be reset so each alias has the proper path to its home directories. Once that is fixed then worry about PHPmyAdmin last.

Remember that each time you make a change in an config file for httpd, you need to restart httpd before the change takes affect.
computersavvy,

On Kubuntu so main/default config file at:

/etc/apache2/apache2.conf

TBNK
 
Old 01-02-2021, 02:37 PM   #27
TBotNik
Member
 
Registered: May 2016
Location: Greenville, TX
Distribution: Kubuntu 18.04
Posts: 796

Original Poster
Rep: Reputation: Disabled
All,

Sorry but I'm a conceptual person, and none of the concept comes through in any of the Apache docs or HOWTOs I've been reading. Sure it's really simple once I get the concept.

TBNK
 
Old 01-02-2021, 06:50 PM   #28
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
Quote:
Originally Posted by TBotNik View Post
All,

Sorry but I'm a conceptual person, and none of the concept comes through in any of the Apache docs or HOWTOs I've been reading. Sure it's really simple once I get the concept.

TBNK
1. Have you been looking at the logs in /var/log/httpd to see what they might tell you? Properly set up there should be separate logs for each aliased web site. Reading the logs should educate you on what is actually happening.

2. Have you tried disabling the virtual hosts (aliases) and confirmed that everything with the main host web pages is working correctly?

Once that is confirmed then
3. Enable one of the aliases and make certain it is properly configured and serving the right pages, including that it reaches the proper data and returns the proper identification to the asking page.

finally,
4. Once you have worked out the issues with one of the aliases you will have an idea of what to do with the second aliased web pages.

Every task needs completed one step at a time and task 1 is getting the main server site fully functional. Tasks need completed one at a time in sequence as well
 
Old 01-02-2021, 07:03 PM   #29
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
The default /etc/httpd/conf/httpd.conf file has lots of configuration information to properly set it up for the main server.

A copy of most of that file properly set up for the filesystem path to the alias1 data and placed as /etc/httpd/conf.d/alias1.conf configures the aliased web site. One of the important things is the listen directive in that file. It has to be matched to the interface/IP it listens on so the connection is known to be for other than the main server. As a result it requires some appropriate matching network config as well.
 
Old 01-02-2021, 09:14 PM   #30
TBotNik
Member
 
Registered: May 2016
Location: Greenville, TX
Distribution: Kubuntu 18.04
Posts: 796

Original Poster
Rep: Reputation: Disabled
All,

The gurus on the #httpd channel at irc.freenode.net point me to all the Apache docs but I cannot find a single item/article on defining a virtual host outside of /var/www and 100% of my websites and projects are on my 2nd 3TB HD, defined in fstab as /3T/ to autoload on bootup.

I know it is possible because 100% of hosting servers at the hosting houses use typically over 6 drives including RAID arrays, and have most of the accounts on these extra drives.

Sure wish I could find these answers! All help appreciated!

TBNK
 
  


Reply

Tags
aliases, apache, configuration



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
bash script to display alias commands and un-alias any less than 12 characters bani Linux - Newbie 5 01-19-2014 12:34 PM
LXer: alias.sh puts your Linux shell alias on the clouds LXer Syndicated Linux News 0 01-21-2013 12:00 AM
Wildcard email alias in /etc/alias file custangro Linux - Enterprise 1 10-02-2009 12:17 PM
IP alias? Machine name alias? JohnLocke Linux - Newbie 4 01-16-2008 12:21 PM
Alias question (2 commands for one alias) gflores Linux - Newbie 3 01-21-2006 12:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:58 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