Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added a module to manage Apache2 sites #7185

Closed
wants to merge 2 commits into from
Closed

added a module to manage Apache2 sites #7185

wants to merge 2 commits into from

Conversation

berendt
Copy link
Contributor

@berendt berendt commented Apr 28, 2014

releated to issue #7151

@berendt
Copy link
Contributor Author

berendt commented Apr 28, 2014

@kiranos Can you please test if this module is working like expected?

@jimi-c jimi-c added P3 labels Apr 28, 2014
@kiranos
Copy link

kiranos commented Apr 28, 2014

I will test this tomorrow morning and post here with test results.

@kiranos
Copy link

kiranos commented Apr 28, 2014

Just saw the changes and a2query is not a command available in debian repo, might it be this: "apache2ctl, it the binary available in debians repo.

:# whereis a2query
a2query:
:
# apache2ctl -v
Server version: Apache/2.2.22 (Debian)
Server built: Jan 31 2014 18:55:37
~# apache2ctl -h
Usage: /usr/sbin/apache2 [-D name] [-d directory] [-f file]
[-C "directive"] [-c "directive"]
[-k start|restart|graceful|graceful-stop|stop]
[-v] [-V] [-h] [-l] [-L] [-t] [-T] [-S] [-X]
Options:
-D name : define a name for use in directives
-d directory : specify an alternate initial ServerRoot
-f file : specify an alternate ServerConfigFile
-C "directive" : process directive before reading config files
-c "directive" : process directive after reading config files
-e level : show startup errors of level (see LogLevel)
-E file : log startup errors to file
-v : show version number
-V : show compile settings
-h : list available command line options (this page)
-l : list compiled in modules
-L : list available configuration directives
-t -D DUMP_VHOSTS : show parsed settings (currently only vhost settings)
-S : a synonym for -t -D DUMP_VHOSTS
-t -D DUMP_MODULES : show all loaded modules
-M : a synonym for -t -D DUMP_MODULES
-t : run syntax check for config files
-T : start without DocumentRoot(s) check
-X : debug mode (only one worker, do not detach)
Action '-h' failed.
The Apache error log may have more information.

@berendt
Copy link
Contributor Author

berendt commented Apr 28, 2014

It's available on Ubuntu 14.04. I'll check for other ways to check for enabled/disabled sites.

# a2query 
Usage: /usr/sbin/a2query -q -m [MODULE] -s [SITE] -c [CONF] -a -v -M -d -h 
-q              suppress any output. Useful for invocation from scripts
-m [MODULE]     checks whether the module MODULE is enabled, lists all enabled
            modules if no argument was given
-s [SITE]       checks whether the site SITE is enabled, lists all sites if no
            argument was given
-c [CONF]       checks whether the configuration CONF is enabled, lists all
            configurations if no argument was given
-a              returns the current Apache 2 module magic version
-v              returns the current Apache 2 version
-M              returns the enabled Apache 2 MPM
-d              returns the Apache 2 module directory
-h              display this help

@berendt
Copy link
Contributor Author

berendt commented Apr 28, 2014

Using apache2ctl -t -D DUMP_VHOSTS should be possible.

# apache2ctl -t -D DUMP_VHOSTS
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 10.0.2.15. Set the 'ServerName' directive globally to suppress this message
VirtualHost configuration:
*:80                   10.0.2.15 (/etc/apache2/sites-enabled/000-default.conf:1)

@kiranos
Copy link

kiranos commented Apr 28, 2014

great a2query seems to be for apache 2.4 and apache2ctl for apache 2.2 from what I can gather.

@kiranos
Copy link

kiranos commented Apr 28, 2014

an os independent way could be to parse output of a2ensite/a2dissite and from grepping the output decide if the change was made or not ( bash coder:P )

@berendt
Copy link
Contributor Author

berendt commented Apr 28, 2014

closing this pull request because I replaced it with a clean and working pull request at #7194

@berendt berendt closed this Apr 28, 2014
@berendt berendt deleted the apache2_site branch April 28, 2014 18:09
@ansibot ansibot added feature This issue/PR relates to a feature request. and removed feature_pull_request labels Mar 4, 2018
@ansible ansible locked and limited conversation to collaborators Apr 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature This issue/PR relates to a feature request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants