Difference between revisions of "Linksys AC Series Router Configuration Tips for OpenWRT"

m
Line 1,623: Line 1,623:
*Executables / Binaries: /usr/lib/apache2
*Executables / Binaries: /usr/lib/apache2
*User / Group (/etc/group): apache / apache
*User / Group (/etc/group): apache / apache
*For Redhat or


Below is working configuration file for Apache with CGI capability;<div class="toccolours mw-collapsible mw-collapsed" style="overflow:auto; width:100%;">
Below is working configuration file for Apache with CGI capability;<div class="toccolours mw-collapsible mw-collapsed" style="overflow:auto; width:100%;">
Line 1,964: Line 1,965:
find /usr/share/apache2 -type f -exec chmod 644 {} \;
find /usr/share/apache2 -type f -exec chmod 644 {} \;
</syntaxhighlight>
</syntaxhighlight>
=====Notes for Apache=====
=====Additional Notes for Apache Installation=====
In other installations, such as Redhat or CentOS, apache or apache2 is referred to as HTTPD in binary / executables, configuration files, commands, etc.
In other installations, such as Redhat or CentOS, apache or apache2 is referred to as HTTPD in binary / executables, configuration files, commands, etc.


Line 1,974: Line 1,975:
*LoadModule proxy_scgi_module lib/apache2/mod_proxy_scgi.so (Module does NOT exist for OpenWRT)
*LoadModule proxy_scgi_module lib/apache2/mod_proxy_scgi.so (Module does NOT exist for OpenWRT)
*LoadModule cgid_module lib/apache2/mod_cgid.so (does NOT seem to work, even when setting the ScriptSock Directive)
*LoadModule cgid_module lib/apache2/mod_cgid.so (does NOT seem to work, even when setting the ScriptSock Directive)
For Redhat / CentOS / RockyOS and similar users who are used to having HTTPD stuff located in /var/www/html by default, below are some commands to put in the Startup of OpenWRT to make Apache stuff easier to find (if you're on 'auto pilot');
* mkdir /tmp/www
* ln -s /usr/share/apache2/htdocs /var/www/html
* ln -s /usr/share/apache2/cgi-bin /var/www/cgi-bin
* ln -s /usr/share/apache2/error /var/www/error
* ln -s /usr/share/apache2/icons /var/www/icons
...and the reason it's in startup is because the VAR Directory in OpenWRT is actually the TMP Directory (IE, VAR is a softlink / shortcut to TMP), so it disappears after rebooting.
Firewall: Open ports on the firewall if public availability is desired.


====Lighttpd====
====Lighttpd====
Line 2,320: Line 2,333:
As noted previously, but worth mentioning again, OpenWRT names the interactive command line interface for PHP ''php-cli''.  Most sites give examples that use the command ''php'', so to make it easier create a symbolic link with this command: ln -s /usr/bin/php-cli /usr/bin/php  
As noted previously, but worth mentioning again, OpenWRT names the interactive command line interface for PHP ''php-cli''.  Most sites give examples that use the command ''php'', so to make it easier create a symbolic link with this command: ln -s /usr/bin/php-cli /usr/bin/php  


====MariaDB Server====
====MariaDB Server (AKA MySQL)====


=====Installing=====
=====Installing=====
Line 2,331: Line 2,344:
**Move the database to an external eSATA drive: datadir        = /mnt/sdb3/mysql
**Move the database to an external eSATA drive: datadir        = /mnt/sdb3/mysql
**Move the tmp directory to an external eSATA drive: datadir        = /tmp (This directory is relative to the datadir, in that it will be created at the same level as the mysql directory, so this is not an abolute path where it will utilize the /tmp directory in the root of the file system)
**Move the tmp directory to an external eSATA drive: datadir        = /tmp (This directory is relative to the datadir, in that it will be created at the same level as the mysql directory, so this is not an abolute path where it will utilize the /tmp directory in the root of the file system)
*To create the default database: mysql_install_db --force --basedir=/usr
*To create the default database: mysql_install_db --force --basedir=/usr (basedir refers to where the binary files are, not where the database(s) will be)
*Start the service: service mysqldb start
*And of course from the beginning, OpenWRT doesn't have the proper permissions set for the /etc/mysql Service / Daemon files, so: chmod 644 -R /etc/mysql
*Start the service: service mysqld start
*And if there is an error, try this command again: mysql_install_db --force --basedir=/usr
*To create a password for the current user (blank if not configured): /usr/bin/mysqladmin -u root password 'new-password'
*To create a password for the current user (blank if not configured): /usr/bin/mysqladmin -u root password 'new-password'
*Log into the command line for the database: mysql -u root -p or use phpMyAdmin see below
*Log into the command line for the database: mysql -u root -p or use phpMyAdmin see below
Line 2,359: Line 2,374:
Show available storage engines: SHOW ENGINES\G or show engines;
Show available storage engines: SHOW ENGINES\G or show engines;


===phpMyAdmin===
===phpMyAdmin (make sure Apache or another web server is installed and functional)===


*opkg update
*opkg update
Line 4,057: Line 4,072:
</syntaxhighlight></div></div>
</syntaxhighlight></div></div>


==== Cron ====
====Cron====
It works with one minor exception.  For older versions of Webmin, the "Display running status of jobs?" may not work.  Other than that, the below configuration /etc/webmin/cron/config file works;<syntaxhighlight lang="text">
It works with one minor exception.  For older versions of Webmin, the "Display running status of jobs?" may not work.  Other than that, the below configuration /etc/webmin/cron/config file works;<syntaxhighlight lang="text">
show_comment=1
show_comment=1