GithubHelp home page GithubHelp logo

Comments (14)

richardforth avatar richardforth commented on May 26, 2024

from apache2buddy.

varyen avatar varyen commented on May 26, 2024

Sure

VERBOSE: Adding glob to /etc/apache2/vhosts/, is a directory
VERBOSE: Adding /etc/apache2/vhosts/user1: to list of files for processing
VERBOSE: Adding family.user1.com to list of files for processing
VERBOSE: Adding thai.user1.com to list of files for processing
VERBOSE: Adding valery.user1.com to list of files for processing
VERBOSE: Adding  to list of files for processing
VERBOSE: Adding /etc/apache2/vhosts/user2: to list of files for processing

................

VERBOSE: Processing /etc/apache2/vhosts/user1:
Uncaught exception from user code:
        Unable to open file: /etc/apache2/vhosts/user1:
        main::find_included_files(ARRAY(0x1830b60), ARRAY(0x18312b0), "/etc/apache2") called at ./apache2buddy.pl line 314
        main::build_config_array("/etc/apache2/apache2.conf", "/etc/apache2") called at ./apache2buddy.pl line 1586
        main::preflight_checks() called at ./apache2buddy.pl line 2032

from apache2buddy.

richardforth avatar richardforth commented on May 26, 2024

from apache2buddy.

richardforth avatar richardforth commented on May 26, 2024

from apache2buddy.

richardforth avatar richardforth commented on May 26, 2024

from apache2buddy.

richardforth avatar richardforth commented on May 26, 2024

Thinking I need to check each expanded file to see if it is either a file or a directory then decide

directory = dont add to array
file = add to array

at the moment:

VERBOSE: Adding /etc/apache2/vhosts/user1: to list of files for processing = WRONG IS DIRECTORY
VERBOSE: Adding family.user1.com to list of files for processing  =  @EXPECTING /etc/apache2/vhosts/user1/family.user1.com
VERBOSE: Adding thai.user1.com to list of files for processing = EXPECTNG /etc/apache2/vhosts/user1/thai.user1.com
VERBOSE: Adding valery.user1.com to list of files for processing = EXPECTNG /etc/apache2/vhosts/user1/valery.user1.com
VERBOSE: Adding  to list of files for processing  - NOT SURE WHY THIS IS EMPTY STRING
VERBOSE: Adding /etc/apache2/vhosts/user2: to list of files for processing = WRONG IS DIRECTORY

from apache2buddy.

varyen avatar varyen commented on May 26, 2024

Just figured out that **/* is not enough here, if I add another folder inside user1 it won't work. :( And it skips files inside folder we're inspecting, prints only files in subfolders.
I think it's better to use something like find /etc/apache2/vhosts/ instead of ls, it prints all files recursively. Just need to skip all directories.

About errors:
ls dir/* output (":" after directory name):

SUBFOLDER:
file1 file2 file3
(empty string here)
SUBFOLDER2:

P.S.

from apache2buddy.

varyen avatar varyen commented on May 26, 2024

Include lines are:

Include conf.d/
Include vhosts-default/
Include vhosts/

Then it's user under vhosts and separate config for each vhost inside user folder.

That's the way latest ISPManager panel organizes it's vhosts (pretty nice panel btw).

from apache2buddy.

richardforth avatar richardforth commented on May 26, 2024

from apache2buddy.

varyen avatar varyen commented on May 26, 2024

Why is it broken? Apache starts and every vhost works.
https://httpd.apache.org/docs/2.4/mod/core.html#include

Shell-style (fnmatch()) wildcard characters can be used in the filename or directory parts of the path to include several files at once, in alphabetical order. In addition, if Include points to a directory, rather than a file, Apache httpd will read all files in that directory and any subdirectory.

It's not recommended only because of "it is easy to accidentally leave temporary files" and apache won't start at all in this case. But anyway, it's a documented feature.
ls output breaks your code if there're more directories under.

As I said before it's managed by web hosting panel (ISPManager) that way. :) It's pretty popular in Russia and Eastern Europe.

from apache2buddy.

richardforth avatar richardforth commented on May 26, 2024

from apache2buddy.

varyen avatar varyen commented on May 26, 2024

Still, it's possible, it's documented and it's used that way in many cases.

I understand that for some reason this bug have never been discovered (submitted?) for all project time being. So it's your decision whether to consider this case or not. All this long code with globs with dir/* (not dir/*.conf as recommended) could just be find dir/, it's universal solution.
You you just don't have time I can prepare and send you PR with this change. Is it worth it?

from apache2buddy.

richardforth avatar richardforth commented on May 26, 2024

from apache2buddy.

richardforth avatar richardforth commented on May 26, 2024

from apache2buddy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.