jamroll has asked for the wisdom of the Perl Monks concerning the following question:
I have just rid myself of THEE absolute worstest (yes, it's not a word) virus ever created, Windows (specifically windows 10) and upgraded to Ubuntu 17.04. I'm completely noob, so I know not all of exactly what info you folks need to assist, so forgive me if i left something critical out.
anyways, here goes.i am fairly certain i have perl installed (although i have no clue how to check). i know i have apache2 installed - i can get it to show web pages when i point my browser at http://localhost/index.html (which i have since deleted and replaced with all my perl scripts).
i do NOT use a cgi-bin folder, cuz that just confuses the bejeepers outta me, and i don't think it's really necessary for the task at hand. I just dump all of my scripts into /var/www/html (and the modules i create are under a subfolder, ./Pm).at first, i was getting a 403 error (forbidden). after about two hours of searching, and fiddling, i managed to get that error to go away, and now, apache2 serves up my code to the browser (which is a might bit better than the 403 error, i should add) but it's still not quite right, of course. lord knows I don't want users seeing my code....(there's nothing unbecoming of a good coder going on here, just don't want my ugly code displayed for the entire world to laugh at). alas, i just cannot figure out how to get apache2 to run the script, rather than just sending the code as plain text to the browser.
many sites are telling me to download all kinds of things and compile those things, and make tons of modifications to files in a bazillion places. when i had this setup on winblows, i had little to no problem just uncommenting "LoadModule cgi_module modules/mod_cgi.so" in the httpd.conf file...but, none of these lines exist in the apache2.conf file i find on this setup, so i hesitate just dumping that line into the conf file. so, i follow other instructions, and mod the conf file as directed, and i get this:this is so very very cryptic to a total noob...% sudo /etc/init.d/apache2 restart [....] Restarting apache2 (via systemctl): apache2.serviceJob for apac +he2.service failed because the control process exited with error code +. See "systemctl status apache2.service" and "journalctl -xe" for detail +s. failed! jamroll@Vaio:/usr/src$ systemctl status apache2.service ● apache2.service - The Apache HTTP Server Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendo +r preset: enabled) Drop-In: /lib/systemd/system/apache2.service.d └─apache2-systemd.conf Active: failed (Result: exit-code) since Sat 2017-07-15 13:41:26 PD +T; 10s ago Process: 29328 ExecStop=/usr/sbin/apachectl stop (code=exited, statu +s=1/FAILURE) Process: 29816 ExecStart=/usr/sbin/apachectl start (code=exited, sta +tus=1/FAILURE) Main PID: 28931 (code=exited, status=0/SUCCESS) CPU: 61ms Jul 15 13:41:25 Vaio systemd[1]: Starting The Apache HTTP Server... Jul 15 13:41:26 Vaio apachectl[29816]: AH00526: Syntax error on line 1 +76 of /etc/apache2/apache2.conf: Jul 15 13:41:26 Vaio apachectl[29816]: Invalid command 'PerlModule', p +erhaps misspelled or defined by a module not included in the Jul 15 13:41:26 Vaio apachectl[29816]: Action 'start' failed. Jul 15 13:41:26 Vaio apachectl[29816]: The Apache error log may have m +ore information. Jul 15 13:41:26 Vaio systemd[1]: apache2.service: Control process exit +ed, code=exited status=1 Jul 15 13:41:26 Vaio systemd[1]: Failed to start The Apache HTTP Serve +r. Jul 15 13:41:26 Vaio systemd[1]: apache2.service: Unit entered failed +state. Jul 15 13:41:26 Vaio systemd[1]: apache2.service: Failed with result ' +exit-code'. [2]+ Stopped systemctl status apache2.service
honestly, i don't wish to use cgi-bin or any other folder. i like my current setup of just dumping them all into /var/www/html it has served me well in the past, and i wish to stick with it.
um, what else...oh yes - i wish to not have to "sudo" into the conf files all the time - my password is not easy to type. it's cumbersome having to work that way all the time for a simple one line config, or having to go in/out restart apache, realize there's an error, and repeat. can take hours to solve one little booboo and it's frustrating to have to jump through all of these hoops! is there an easier way to accomplish my taks without having to always sudo into my editor to edit the apache2.conf file? can't i just tell the system to give me unfettered access to that file? no one uses this computer but me (i have a wife, and one kid here, but they use their own machines and have no access to this machine without my really strong password, so local access can be wide open on this puppy).
so, again, if i missed something, forgive me - i'm on a MASSIVE learning curve here, and may not even realize you need more info. i'm on tilt, and a one man band as it were. I'm the host, developer and all other things web-site related. 100% alone on this. So, with that said, allow me to make one more note: I'm totally noob. so, info given has to be SIMPLE, and EASY for a noob to understand. you can't just say "chmod this file", as I may not know what that means or even how to accomplish the task (let me just add that i have figured out chmod, i just use that as an example of how you might confuse Jarett by saying "just do this"...it's NOT that simple)...i'm transitioning from winblows to linux so i have all these silly MS notions in my head. best if you can relate windows to linux for me....i'm a quick study - certainly am well versed in the techy world, so some jargon is okay, save for linux jargon, you might lose me...see?I hope i have conveyed well enough, and pray you guys get it and don't poop on me too hard for missing some details...i'm happy to do exactly what you need from me....
sincerely on tilt,jarett
oh...i guess you'd like to see my apache2.conf file, eh? lolin its entirety:
# This is the main Apache server configuration file. It contains the # configuration directives that give the server its instructions. # See http://httpd.apache.org/docs/2.4/ for detailed information about # the directives and /usr/share/doc/apache2/README.Debian about Debian + specific # hints. # # # Summary of how the Apache 2 configuration works in Debian: # The Apache 2 web server configuration in Debian is quite different t +o # upstream's suggested way to configure the web server. This is becaus +e Debian's # default Apache2 installation attempts to make adding and removing mo +dules, # virtual hosts, and extra configuration directives as flexible as pos +sible, in # order to make automating the changes and administering the server as + easy as # possible. # It is split into several files forming the configuration hierarchy o +utlined # below, all located in the /etc/apache2/ directory: # # /etc/apache2/ # |-- apache2.conf # | `-- ports.conf # |-- mods-enabled # | |-- *.load # | `-- *.conf # |-- conf-enabled # | `-- *.conf # `-- sites-enabled # `-- *.conf # # # * apache2.conf is the main configuration file (this file). It puts t +he pieces # together by including all remaining configuration files when start +ing up the # web server. # # * ports.conf is always included from the main configuration file. It + is # supposed to determine listening ports for incoming connections whi +ch can be # customized anytime. # # * Configuration files in the mods-enabled/, conf-enabled/ and sites- +enabled/ # directories contain particular configuration snippets which manage + modules, # global configuration fragments, or virtual host configurations, # respectively. # # They are activated by symlinking available configuration files fro +m their # respective *-available/ counterparts. These should be managed by u +sing our # helpers a2enmod/a2dismod, a2ensite/a2dissite and a2enconf/a2discon +f. See # their respective man pages for detailed information. # # * The binary is called apache2. Due to the use of environment variab +les, in # the default configuration, apache2 needs to be started/stopped wit +h # /etc/init.d/apache2 or apache2ctl. Calling /usr/bin/apache2 direct +ly will not # work with the default configuration. # Global configuration # # # ServerRoot: The top of the directory tree under which the server's # configuration, error, and log files are kept. # # NOTE! If you intend to place this on an NFS (or otherwise network) # mounted filesystem then please read the Mutex documentation (availab +le # at <URL:http://httpd.apache.org/docs/2.4/mod/core.html#mutex>); # you will save yourself a lot of trouble. # # Do NOT add a slash at the end of the directory path. # #ServerRoot "/etc/apache2" # # The accept serialization lock file MUST BE STORED ON A LOCAL DISK. # #Mutex file:${APACHE_LOCK_DIR} default # # The directory where shm and other runtime files will be stored. # DefaultRuntimeDir ${APACHE_RUN_DIR} # # PidFile: The file in which the server should record its process # identification number when it starts. # This needs to be set in /etc/apache2/envvars # PidFile ${APACHE_PID_FILE} # # Timeout: The number of seconds before receives and sends time out. # Timeout 300 # # KeepAlive: Whether or not to allow persistent connections (more than # one request per connection). Set to "Off" to deactivate. # KeepAlive On # # MaxKeepAliveRequests: The maximum number of requests to allow # during a persistent connection. Set to 0 to allow an unlimited amoun +t. # We recommend you leave this number high, for maximum performance. # MaxKeepAliveRequests 100 # # KeepAliveTimeout: Number of seconds to wait for the next request fro +m the # same client on the same connection. # KeepAliveTimeout 5 # These need to be set in /etc/apache2/envvars User ${APACHE_RUN_USER} Group ${APACHE_RUN_GROUP} # # HostnameLookups: Log the names of clients or just their IP addresses # e.g., www.apache.org (on) or 204.62.129.132 (off). # The default is off because it'd be overall better for the net if peo +ple # had to knowingly turn this feature on, since enabling it means that # each client request will result in AT LEAST one lookup request to th +e # nameserver. # HostnameLookups Off # ErrorLog: The location of the error log file. # If you do not specify an ErrorLog directive within a <VirtualHost> # container, error messages relating to that virtual host will be # logged here. If you *do* define an error logfile for a <VirtualHost +> # container, that host's errors will be logged there and not here. # ErrorLog ${APACHE_LOG_DIR}/error.log # # LogLevel: Control the severity of messages logged to the error_log. # Available values: trace8, ..., trace1, debug, info, notice, warn, # error, crit, alert, emerg. # It is also possible to configure the log level for particular module +s, e.g. # "LogLevel info ssl:warn" # LogLevel warn # Include module configuration: IncludeOptional mods-enabled/*.load IncludeOptional mods-enabled/*.conf # Include list of ports to listen on Include ports.conf # Sets the default security model of the Apache2 HTTPD server. It does # not allow access to the root filesystem outside of /usr/share and /v +ar/www. # The former is used by web applications packaged in Debian, # the latter may be used for local directories served by the web serve +r. If # your system is serving content from a sub-directory in /srv you must + allow # access here, or in any related virtual host. <Directory /> Options FollowSymLinks AllowOverride None Require all denied </Directory> <Directory /usr/share> AllowOverride None Require all granted </Directory> <Directory /var/www/> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory> PerlModule ModPerl::Registry <location "/var/www/html"> sethandler perl-script perlhandler ModPerl::Registry options +ExecCGI </location> <Directory /var/www/html> Options Indexes FollowSymLinks ExecCGI AllowOverride All Require all granted allow from all </Directory> #<Directory /srv/> # Options Indexes FollowSymLinks # AllowOverride None # Require all granted #</Directory> # AccessFileName: The name of the file to look for in each directory # for additional configuration directives. See also the AllowOverride # directive. # AccessFileName .htaccess # # The following lines prevent .htaccess and .htpasswd files from being # viewed by Web clients. # <FilesMatch "^\.ht"> Require all denied </FilesMatch> # # The following directives define some format nicknames for use with # a CustomLog directive. # # These deviate from the Common Log Format definitions in that they us +e %O # (the actual bytes sent including headers) instead of %b (the size of + the # requested file), because the latter makes it impossible to detect pa +rtial # requests. # # Note that the use of %{X-Forwarded-For}i instead of %h is not recomm +ended. # Use mod_remoteip instead. # LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Ag +ent}i\"" vhost_combined LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\ +"" combined LogFormat "%h %l %u %t \"%r\" %>s %O" common LogFormat "%{Referer}i -> %U" referer LogFormat "%{User-agent}i" agent # Include of directories ignores editors' and dpkg's backup files, # see README.Debian for details. # Include generic snippets of statements IncludeOptional conf-enabled/*.conf # Include the virtual host configurations: IncludeOptional sites-enabled/*.conf # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(Mostly OT) Re: perl and apache2 on ubuntu 17.04
by hippo (Archbishop) on Jul 15, 2017 at 21:38 UTC | |
|
Re: perl and apache2 on ubuntu 17.04
by huck (Prior) on Jul 15, 2017 at 22:04 UTC | |
|
Re: perl and apache2 on ubuntu 17.04
by shmem (Chancellor) on Jul 16, 2017 at 17:39 UTC | |
|
Re: perl and apache2 on ubuntu 17.04
by chacham (Prior) on Jul 17, 2017 at 11:18 UTC | |
|
Re: perl and apache2 on ubuntu 17.04
by jamroll (Beadle) on Jul 18, 2017 at 20:33 UTC | |
by huck (Prior) on Jul 18, 2017 at 23:07 UTC | |
by jamroll (Beadle) on Jul 18, 2017 at 23:15 UTC | |
by hippo (Archbishop) on Jul 18, 2017 at 21:22 UTC | |
by jamroll (Beadle) on Jul 18, 2017 at 21:58 UTC | |
by jamroll (Beadle) on Jul 18, 2017 at 21:33 UTC | |
by haukex (Archbishop) on Jul 19, 2017 at 06:58 UTC | |
by jamroll (Beadle) on Jul 19, 2017 at 13:57 UTC | |
|