Re: waaaay off topic -- apache/vhost

2020-06-12 Thread bruce
Tim!

You are so correct on the "typo"
/var/www/social/html

Someone else had mentioned this I kept looking over -- completely
missing it!  two sets of eyeballs. thanks

I'll test what you sent. It's a start to help trying to figure out
what might be user issues from my side.

'ppreciate it all!

On Fri, Jun 12, 2020 at 11:40 AM Tim via users
 wrote:
>
> On Fri, 2020-06-12 at 09:54 -0400, bruce wrote:
> > The TLDR; -- Trying to set up the vhost block to be able to access a
> > test site built on an app called "open social" from/basedon Drupal.
> > The app is https://github.com/goalgorilla/open_social
>
> Okay, I don't do drupal (or other content management package), but I do
> use Apache and virtual hosting for several different websites, hosting
> flat HTML files.  Though I saw a note that Apache will be changing how
> they configure virtual hosting some time soon (just to throw a spanner
> in the works).
>
> > I have a "test" vhost that kind of works, -- uses
> > Alias/DirectoryBlock/DocumentRoot, but it kept generating redirect
> > errs. Someone on the OpenSocial slack channel said to get rid of that
> > and .. But didn't say how to implement a correct config file.
> >
> > Trial/Error sometimes not the most efficient approach.
> >
> > The test url that currently generates a 403 is:
> > http://161.35.180.212/social/
>
> I get a forbidden 403, too.
>
> > I've managed to generate the required files via Composer, and the
> > files are stored in the following dir:
> >
> > /www/var/social
>
> Is that filepath correct?  If you've made a special www directory in
> the root of the directory tree, SELinux is going to bite you for trying
> to serve files from a non-standard filepath.  I'll presume you really
> meant /var/www/social and all your content is within that filepath.
>
> e.g. /var/www/social/homepage.html could be your homepage file.
>
> For that kind of thing, I have individual configuration files per site
> in the /etc/httpd/conf.d/ directory.  I'll try to mock one up for you
>
> Create a file: /etc/httpd/conf.d/social.conf
>
> 
> ServerName www.social.example.com
> ServerAliassocial.example.com
> UseCanonicalName   On
> ServerAdminbadoug...@gmail.com
> DocumentRoot   /var/www/social
> DirectoryIndex homepage.html default.html index.html index.php
> OptionsIndexes FollowSymLinks MultiViews Includes
> ErrorLog   logs/social-error_log
> CustomLog  logs/socail-access_log combined
> 
> The ServerName will use your actual domain name.
>
> The ServerAlias can list alternatives (e.g. making a site work with or
> without the www prefix, or even for completely different hostnames,
> such as your local hostname when testing within your LAN).  You list
> all alternative names separated by blank spaces.
>
> UseCanonicalName tells the server to use your domain name, correcting
> how someone may have alternatively accessed the site (e.g. via IP).
>
> ServerAdmin is just a contact address that the server may display on
> some error pages.  It's presumed to be an email, and many applications
> may only accept that.  But it's possible to use a URL (e.g. a contact
> details page).
>
> DocumentRoot is where the files are served from (NB what I asked before
> about your unusual filepath).
>
> DirectoryIndex is the default file the server will read if someone
> requests an address of a directory, rather than a file.
>
> e.g. when they browse to www.example.com/something/
>  rather than www.example.com/something/page.html
>
> You can list more than one filename for it to look for.  While
> index.html is the typical default value, not all default web pages are
> actually an index, nor a homepage (which is really the landing page for
> the whole site), so you customise it to suit yourself.  And if you're
> using scripted languages like PHP, that needs to be enabled, too (the
> handler for PHP, etc).
>
> Options can be specified to override default webserver options
> specified in the main configuration.  You may not need any of these
> examples.  Here, Indexes allows the listing of files in directories
> that didn't include a default page for DirectoryIndex to find.
> FollowSymLinks allows the webserver to use symlinks pointing to files
> outside of your DocumentRoot (though other things may override that).
> MultiViews allows the server to choose different media for the same
> file, as best suits the situation (e.g. a page could want to display an
> image called "diagram" and in your directory you had diagram.jpg,
> diagram.gif, diagram.png files of the same image, it'd pick what it
> thought was best).  It can also be used for multi-language pages (you
> could have welcome.html.en file  and welcome.html.es and
> welcome.html.ru and when someone requested welcome.html they'd get the
> page in one of the languages they've configure their browser to
> support).  And Includes let pages 

Re: waaaay off topic -- apache/vhost

2020-06-12 Thread Tim via users
On Fri, 2020-06-12 at 09:54 -0400, bruce wrote:
> The TLDR; -- Trying to set up the vhost block to be able to access a
> test site built on an app called "open social" from/basedon Drupal.
> The app is https://github.com/goalgorilla/open_social

Okay, I don't do drupal (or other content management package), but I do
use Apache and virtual hosting for several different websites, hosting
flat HTML files.  Though I saw a note that Apache will be changing how
they configure virtual hosting some time soon (just to throw a spanner
in the works).

> I have a "test" vhost that kind of works, -- uses
> Alias/DirectoryBlock/DocumentRoot, but it kept generating redirect
> errs. Someone on the OpenSocial slack channel said to get rid of that
> and .. But didn't say how to implement a correct config file.
> 
> Trial/Error sometimes not the most efficient approach.
> 
> The test url that currently generates a 403 is:
> http://161.35.180.212/social/

I get a forbidden 403, too.

> I've managed to generate the required files via Composer, and the
> files are stored in the following dir:
> 
> /www/var/social

Is that filepath correct?  If you've made a special www directory in
the root of the directory tree, SELinux is going to bite you for trying
to serve files from a non-standard filepath.  I'll presume you really
meant /var/www/social and all your content is within that filepath.

e.g. /var/www/social/homepage.html could be your homepage file.

For that kind of thing, I have individual configuration files per site
in the /etc/httpd/conf.d/ directory.  I'll try to mock one up for you

Create a file: /etc/httpd/conf.d/social.conf


ServerName www.social.example.com   
ServerAliassocial.example.com
UseCanonicalName   On
ServerAdminbadoug...@gmail.com
DocumentRoot   /var/www/social
DirectoryIndex homepage.html default.html index.html index.php
OptionsIndexes FollowSymLinks MultiViews Includes
ErrorLog   logs/social-error_log
CustomLog  logs/socail-access_log combined
  the webserver renders the
content of that nav.menu file into the page, instead of that bit of
code.  It allows me to write one common navigation menu that all pages
will use, and I can change the navigation menu at any time and not have
to rewrite all the pages with the new links.

ErrorLog and CustomLog say where to save logfiles (above I've used
relative links, to its default logpath, but could be a full filepath),
and there's a code (combined) for the formatting of the data to log.

With a configuration file like that, and a test HTML page in the
Document root (/var/www/social/default.html), you should see that page
when you browse to http://www.social.example.com/ (or whatever actual
domain name you own).

It is dependent on there being a DNS record associating the webserver's
numerical IP address with that domain name, but for internal testing
you can do it within your /etc/hosts file.

Elsewhere, in the main configuration, you'll have a couple of things
that relate to file access permissions.  They'll stop Apache reading
the whole directory tree of your OS.  Allow access to anything within
/var/www (including sub-directories).  And allow further options to a
specific sub-directory, like /var/www/html (the default website for the
Apache installation).


AllowOverride none
Require all denied



AllowOverride None
# Allow open access:
Require all granted



Options Indexes FollowSymLinks
AllowOverride None
Require all granted


You may, or may not, need to do so something similar for your own
website directory root.  There are all sorts of ways of making things
more secure for you, and segregating types of content per site.

e.g. /var/www/social/cgi/
 /var/www/social/html/
 /var/www/social/databases/

 /var/www/anothersite/cgi/
 /var/www/anothersite/html/
 /var/www/anothersite/data/

Your CGI scripts going in *your* cgi directory, your webpages that
people request to view inside your html directory, and content that
your data management software uses inside the databases directory where
it can access it, but the general public cannot.

Someone else's website files go elsewhere, where there's no
interaction.

Anybody who tried to connect to your IP, without using your site's
domain name, would connect to Apache's default service, which keeps its
files inside /var/www/html/  Put a test page in there for yourself, so
you can test what's happening while you work this all out.

Of course how you set things up depends on what other software you're
using.  What it needs, what it lets you do, etc...

> within the /www/var/social  (the files for open social are)
> 
> apache apache109 Jun 11 03:34 .
> apache apache128 Jun 12 04:16 ..
> apache apache   1858 Jun 11 03:33 composer.json
> apache apache 365863 Jun 11 03:40 composer.lock
> apache apache602 Jun 11 03:33 

Re: waaaay off topic -- apache/vhost

2020-06-12 Thread Alexander Dalloz

Am 12.06.2020 um 15:54 schrieb bruce:

/www/var/social

within the /www/var/social  (the files for open social are)


2 times a typo for the path?


apache apache109 Jun 11 03:34 .
apache apache128 Jun 12 04:16 ..
apache apache   1858 Jun 11 03:33 composer.json
apache apache 365863 Jun 11 03:40 composer.lock
apache apache602 Jun 11 03:33 .gitignore
apache apache   4096 Jun 11 03:40 html
apache apache   1826 Jun 11 03:33 README.md
apache apache   4096 Jun 11 03:40 vendor

within the /www/var/social/html  (the files for open social are)
drwxrwxr-x.  8 apache apache 4096 Jun 11 03:40 .
drwxrwxr-x.  4 apache apache  109 Jun 11 03:34 ..
-rw-rw-rw-.  1 apache apache  385 Jun 11 03:40 autoload.php
drwxrwxr-x. 14 apache apache 4096 Jun 11 03:40 core
-rw-rw-r--.  1 apache apache 1025 Jun 11 03:40 .csslintrc
-rw-rw-r--.  1 apache apache  357 Jun 11 03:40 .editorconfig
-rw-rw-r--.  1 apache apache  151 Jun 11 03:40 .eslintignore
-rw-rw-r--.  1 apache apache   41 Jun 11 03:40 .eslintrc.json
-rw-rw-r--.  1 apache apache 3858 Jun 11 03:40 .gitattributes
-rw-rw-r--.  1 apache apache 7878 Jun 11 03:40 .htaccess
-rw-rw-r--.  1 apache apache 2314 Jun 11 03:40 .ht.router.php
-rw-rw-r--.  1 apache apache  549 Jun 11 03:40 index.php
drwxrwxr-x. 29 apache apache 4096 Jun 11 03:40 libraries
drwxrwxr-x.  3 apache apache   21 Jun 11 03:33 modules
drwxrwxr-x.  3 apache apache   21 Jun 11 03:34 profiles
-rw-rw-r--.  1 apache apache 1594 Jun 11 03:40 robots.txt
drwxrwxr-x.  3 apache apache  112 Jun 11 03:34 sites
drwxrwxr-x.  3 apache apache   21 Jun 11 03:34 themes
-rw-rw-r--.  1 apache apache  848 Jun 11 03:40 update.php
-rw-rw-r--.  1 apache apache 4566 Jun 11 03:40 web.config


Rethink if it is really required to permit the webserver to be able to 
modify (write) its own content files. Certainly many file of the 
application can be protected by being root:root owned and just read by 
the apache user.



In order to test the app, I need to be able to have a valid
virtualhost to allow the user to access the site
http://1.2.3.4/??

the current   (doesn't work)!!
/etc/httpd/sites-available/virtualhosts.conf


That's a Debian style config setup. While the active config is being 
reflected by /etc/httpd/sites-enabled/foo.conf being the symlink to the 
active config.




 # VirtualHost file to handle aliases


#Options Indexes FollowSymLinks MultiViews
  #AllowOverride All
  #Order allow,deny
  #allow from all

#DirectoryIndex index.html index.php
  #Require all granted

 # Set the default document root for Apache (if the URL
 # doesn't start with "/foo" or "/oxwall")...
 #drupal cat DocumentRoot "/var/www/html"
 DocumentRoot "/var/www/social/html"


See the difference of the DocumentRoot path to what you wrote above. 
Said that, /var/www/social would be the appropriate path on Fedora and 
"www/var/" ugly.


Look into the log files generated by Apache when accessing your server 
and application. That will tell you where to search.


Alexander
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: waaaay off topic -- apache/vhost

2020-06-12 Thread bruce
On Fri, Jun 12, 2020 at 8:21 AM Tim via users
 wrote:
>
> On Fri, 2020-06-12 at 05:00 -0400, bruce wrote:
> > I've got a topic that's way off topic. It's dealing with
> > apache/vhost.
> > I'm screwing something up. Wondered if I can post it here.
>
> You may as well ask about the problem, then you'll know if people can
> help.  I use virtual hosting on Apache, I've been doing so for years.
>

Hi Tim,

Thanks for the reply.

The TLDR; -- Trying to set up the vhost block to be able to access a
test site built on an app called "open social" from/basedon Drupal.
The app is https://github.com/goalgorilla/open_social

I have a "test" vhost that kind of works, -- uses
Alias/DirectoryBlock/DocumentRoot, but it kept generating redirect
errs. Someone on the OpenSocial slack channel said to get rid of that
and .. But didn't say how to implement a correct config file.

Trial/Error sometimes not the most efficient approach.

The test url that currently generates a 403 is:
http://161.35.180.212/social/


I've managed to generate the required files via Composer, and the
files are stored in the following dir:

/www/var/social

within the /www/var/social  (the files for open social are)

apache apache109 Jun 11 03:34 .
apache apache128 Jun 12 04:16 ..
apache apache   1858 Jun 11 03:33 composer.json
apache apache 365863 Jun 11 03:40 composer.lock
apache apache602 Jun 11 03:33 .gitignore
apache apache   4096 Jun 11 03:40 html
apache apache   1826 Jun 11 03:33 README.md
apache apache   4096 Jun 11 03:40 vendor

within the /www/var/social/html  (the files for open social are)
drwxrwxr-x.  8 apache apache 4096 Jun 11 03:40 .
drwxrwxr-x.  4 apache apache  109 Jun 11 03:34 ..
-rw-rw-rw-.  1 apache apache  385 Jun 11 03:40 autoload.php
drwxrwxr-x. 14 apache apache 4096 Jun 11 03:40 core
-rw-rw-r--.  1 apache apache 1025 Jun 11 03:40 .csslintrc
-rw-rw-r--.  1 apache apache  357 Jun 11 03:40 .editorconfig
-rw-rw-r--.  1 apache apache  151 Jun 11 03:40 .eslintignore
-rw-rw-r--.  1 apache apache   41 Jun 11 03:40 .eslintrc.json
-rw-rw-r--.  1 apache apache 3858 Jun 11 03:40 .gitattributes
-rw-rw-r--.  1 apache apache 7878 Jun 11 03:40 .htaccess
-rw-rw-r--.  1 apache apache 2314 Jun 11 03:40 .ht.router.php
-rw-rw-r--.  1 apache apache  549 Jun 11 03:40 index.php
drwxrwxr-x. 29 apache apache 4096 Jun 11 03:40 libraries
drwxrwxr-x.  3 apache apache   21 Jun 11 03:33 modules
drwxrwxr-x.  3 apache apache   21 Jun 11 03:34 profiles
-rw-rw-r--.  1 apache apache 1594 Jun 11 03:40 robots.txt
drwxrwxr-x.  3 apache apache  112 Jun 11 03:34 sites
drwxrwxr-x.  3 apache apache   21 Jun 11 03:34 themes
-rw-rw-r--.  1 apache apache  848 Jun 11 03:40 update.php
-rw-rw-r--.  1 apache apache 4566 Jun 11 03:40 web.config


In order to test the app, I need to be able to have a valid
virtualhost to allow the user to access the site
http://1.2.3.4/??

the current   (doesn't work)!!
/etc/httpd/sites-available/virtualhosts.conf


# VirtualHost file to handle aliases


#Options Indexes FollowSymLinks MultiViews
 #AllowOverride All
 #Order allow,deny
 #allow from all

#DirectoryIndex index.html index.php
 #Require all granted

# Set the default document root for Apache (if the URL
# doesn't start with "/foo" or "/oxwall")...
#drupal cat DocumentRoot "/var/www/html"
DocumentRoot "/var/www/social/html"


# Stick your host name and domain below (commented out for now)...
#ServerName somsiten...@somedomain.tld

# Define where the logs go and what they're called...
ErrorLog "logs/testsite-error_log"
CustomLog "logs/testsite-access_log" common


So, I'm trying to get the virtualhost/apache to match the
dir/tree/files for the open social app to test the app.
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: waaaay off topic -- apache/vhost

2020-06-12 Thread Tim via users
On Fri, 2020-06-12 at 05:00 -0400, bruce wrote:
> I've got a topic that's way off topic. It's dealing with
> apache/vhost.
> I'm screwing something up. Wondered if I can post it here.

You may as well ask about the problem, then you'll know if people can
help.  I use virtual hosting on Apache, I've been doing so for years.

-- 
 
uname -rsvp
Linux 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64
 
Boilerplate:  All unexpected mail to my mailbox is automatically deleted.
I will only get to see the messages that are posted to the mailing list.
 
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: waaaay off topic -- apache/vhost

2020-06-12 Thread George N. White III
On Fri, 12 Jun 2020 at 06:01, bruce  wrote:

> Hi.
>
> I've got a topic that's way off topic. It's dealing with apache/vhost.
> I'm screwing something up. Wondered if I can post it here.
>

It is usually more effective to look for help from a more focused group.
Most Apache discussions are on mail lists:
https://community.apache.org/lists.html

-- 
George N. White III
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: waaaay off topic -- apache/vhost

2020-06-12 Thread Peter Boy


> Am 12.06.2020 um 11:00 schrieb bruce :
> 
> Hi.
> 
> I've got a topic that's way off topic. It's dealing with apache/vhost.
> I'm screwing something up. Wondered if I can post it here.
> 

If it’s in Fedora I think it’s OK you may ask (me)


___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org