You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[2.0.0] add ServerName & ServerPort on import Combined & Error logs stage tables. Option allow adding domains to logs.
23
+
-[2.0.0] add ERROR_SERVERNAME,ERROR_SERVERPORT,COMBINED_SERVERNAME & COMBINED_SERVERPORT variables to settings.env.
24
+
-[2.0.0] add SET servername & serverport COLUMN values to LOAD DATA statements.
25
+
-[2.0.0] create log_referer, log_remotehost, log_servername, log_serverport TABLES to assoicate Access and Error logs.
26
+
-[2.0.0] add server_name & server_port COLUMNS to import_file TABLE. Provides second option to update Apache logs without %v.
27
+
-[2.0.0] modify process_access_import & process_error_import to populate empty server_name & server_port with ServerName & ServerPort from import_file TABLE.
28
+
-[2.0.0] add WATCH_LOG to setting Log Level in watch4logs.py. 0=no messages, 1=message when files found, 2=message when checking for files & files found
29
+
-[2.0.0] add class bcolors to place RED BACKGROUND on all ERROR - messsages
30
+
-[2.0.0] add file - mysql_user_and_grants.sql - MySQL USER and GRANTS file for CREATE USER apache_upload for Python module
31
+
-[2.0.0] add file - call_processes.sql - description and CALL command lines for 5 Stored Procedures
32
+
-[2.0.0] add file - CHANGLOG.md - for single place to list all code and database changes
Copy file name to clipboardExpand all lines: .github/INSTALL.md
+43-46Lines changed: 43 additions & 46 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,14 @@
1
1
## Installation Instructions
2
-
The steps are very important to make installation painless. Please follow instructions in order.
2
+
The steps are important to make installation painless.
3
3
4
4
### 1. MySQL Steps
5
-
Before running `apachLogs2MySQL.sql`open file in your favorite editor and do a ***Find and Replace*** of the following User Account with a User Account with DBA Role on server you are installing on. This will make everything much easier. Copy below:
5
+
Before running `apachLogs2MySQL.sql`if `root`@`localhost` does not exist open file and do a ***Find and Replace*** of User Account with a User Account with DBA Role on installation server. Copy below:
6
6
```
7
-
`root`@`%`
7
+
`root`@`localhost`
8
8
```
9
-
Rename above <sup>user</sup> to a <sup>user</sup> on your server. For example - `root`@`%` to `dbadmin`@`localhost`
9
+
Rename above <sup>user</sup> to a <sup>user</sup> on your server. For example - `root`@`localhost` to `dbadmin`@`localhost`
10
10
11
-
The easiest way to install is use MySQL Command Line Client. Login as User with DBA Role and execute the following:
11
+
The easiest way to install is MySQL Command Line Client. Login as User with DBA Role and execute the following:
12
12
```
13
13
source yourpath/apacheLogs2MySQL.sql
14
14
```
@@ -20,7 +20,7 @@ local-infile=1
20
20
After these 3 steps MySQL server should be good to go.
21
21
22
22
### 2. Python Steps
23
-
Install all modules:
23
+
Install all modules (`requirements.txt` in repository):
24
24
```
25
25
pip install -r requirements.txt
26
26
```
@@ -32,7 +32,7 @@ python3 -m ensurepip --upgrade
32
32
If any issues with ***pip install*** occur use individual install commands below:
33
33
34
34
### 3. Required Python Modules
35
-
Python module links & install command lines for each platform. Single quotes around module name are required on macOS. The simplest option is run the command line under '5. Python Steps'. If that works you are all set. The `requirements.txt` file is included in repository.
35
+
Python module links & install command lines for each platform. Single quotes around module name are required on macOS.
36
36
|Python Package|Windows 10 & 11|Ubuntu 24.04|macOS 15.0.1 Darwin 24.0.0|GitHub Repository|
@@ -47,48 +47,45 @@ By default the load_dotenv() is looking for a file name .env which is standard n
47
47
```
48
48
load_dotenv() # Loads variables from .env into the environment
49
49
```
50
-
Windows requires double backslash:
51
-
```
52
-
C:\\Users\\farmf\\Documents\\apacheLogs\\
53
-
```
54
-
Lunix & macOS require single frontslash:
55
-
```
56
-
/home/will/apacheLogs/
57
-
```
58
50
Below is settings.env with default settings for running on Windows 11 Pro workstation. Make sure the correct logFormats are in correct logFormat folders. The application does not currently detect logFormats. Data will not be imported properly if folder settings are not correct.
59
51
### 5. Settings.env Variables
60
52
```
61
-
MYSQL_HOST=localhost # MySQL server
62
-
MYSQL_PORT=3306 # MySQL server port
63
-
MYSQL_USER=root # MySQL server User
64
-
MYSQL_PASSWORD=password # MySQL server User Password
65
-
MYSQL_SCHEMA=apache_logs # MySQL database schema ApacheLogs2MySQL will create
66
-
WATCH_PATH=C:\\Users\\farmf\\Documents\\apacheLogs\\ # watch folder for new files
67
-
WATCH_RECURSIVE=1 # watch all subfolders - 0=no 1=yes
68
-
WATCH_INTERVAL=15 # seconds between watching for new files
69
-
ERROR=1 # process error logs - 0=no 1=yes
70
-
ERROR_LOG=2 # display process error processing to console in python - 0=none 1=summary 2=summary & each file being processed
71
-
ERROR_PATH=C:\\Users\\farmf\\Documents\\apacheLogs\\**/*error*.* # process folder & file patterns for Error Log files - MUST BE Watch folder and can be Subfolders
72
-
ERROR_RECURSIVE=1 # watch all subfolders - 0=no 1=yes
73
-
ERROR_PROCESS=1 # execute MySQL Stored Procedure to import Error log staging table - 0=no 1=yes
74
-
COMBINED=1 # process Common and Combined Access logs - 0=no 1=yes
75
-
COMBINED_LOG=2 # display Common and Combined Access log processing to console in python - 0=none 1=summary 2=summary & each file being processed
76
-
COMBINED_PATH=C:\\Users\\farmf\\Documents\\apacheLogs\\combined\\**/*access*.* # process folder & file patterns for Common and Combined Access files - MUST BE Watch subfolder
77
-
COMBINED_RECURSIVE=1 # watch all subfolders - 0=no 1=yes
78
-
COMBINED_PROCESS=1 # execute MySQL Stored Procedure to import Common and Combined Access staging table - 0=no 1=yes
79
-
VHOST=1 # process Vhost Access logs - 0=no 1=yes
80
-
VHOST_LOG=2 # display Vhost Access log processing to console in python - 0=none 1=summary 2=summary & each file being processed
81
-
VHOST_PATH=C:\\Users\\farmf\\Documents\\apacheLogs\\vhost\\**/*access*.* # process folder & file patterns for Vhost Access files - MUST BE Watch subfolder
82
-
VHOST_RECURSIVE=1 # watch all subfolders - 0=no 1=yes
83
-
VHOST_PROCESS=1 # execute MySQL Stored Procedure to import Vhost Access log staging table - 0=no 1=yes
84
-
CSV2MYSQL=1 # process error logs - 0=no 1=yes
85
-
CSV2MYSQL_LOG=2 # display Csv2mysql Access log processing to console in python - 0=none 1=summary 2=summary & each file being processed
86
-
CSV2MYSQL_PATH=C:\\Users\\farmf\\Documents\\apacheLogs\\csv2mysql\\**/*access*.* # process folder & file patterns for Csv2mysql Access files - MUST BE Watch subfolder
87
-
CSV2MYSQL_RECURSIVE=1 # watch all subfolders - 0=no 1=yes
88
-
CSV2MYSQL_PROCESS=1 # execute MySQL Stored Procedure to import Csv2mysql Access log staging table - 0=no 1=yes
89
-
USERAGENT=1 # process csv2mysql Access logs - 0=no 1=yes
90
-
USERAGENT_LOG=2 # display userAgent processing to console in python - 0=none 1=summary 2=summary & each file being processed
91
-
USERAGENT_PROCESS=1 # execute MySQL Stored Procedure process userAgent parsed table into 14 normalized userAgent tables - 0=no 1=yes
If MySQL steps completed successfully, successfully installed Python modules, renamed file `settings.env` to `.env`, and updated MySQL server connection and log folder variables it is time to run application.
0 commit comments