InnoDB is the better engine and is the one I will be using in all of my projects. InnoDB is faster and more resilient to errors.
These article brings together all of my InnoDB notes which were built while trying to get my head around the different SQL engines (InnoDB vs MyISAM) and which one to use.
ALTER TABLE my_table ENGINE = InnoDB;
<?php // connect your database here first $dbhost = 'localhost'; $dbuser = '*********'; $dbpass = '*********'; $dbname = '*********'; $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql'); mysql_select_db($dbname); // Actual code starts here $sql = "SHOW tables"; $rs = mysql_query($sql); while($row = mysql_fetch_array($rs)) { $tbl = $row[0]; $sql = "ALTER TABLE $tbl ENGINE=INNODB"; mysql_query($sql); } ?>
Default configuration and explanation of the settings mysqld --no-defaults --verbose --help or, on a running 10.1+ server, by executing SELECT variable_name, default_value FROM information_schema.system_variables ORDER BY variable_name
mysqld --verbose --help mysqladmin variables
This is an example my.cnf/my.ini (my-innodb-heavy-4G.ini) taken from an old version of Xampp running on Windows. This is useful because it has annotations against a lot of the settings.
#BEGIN CONFIG INFO #DESCR: 4GB RAM, InnoDB only, ACID, few connections, heavy queries #TYPE: SYSTEM #END CONFIG INFO # # This is a MySQL example config file for systems with 4GB of memory # running mostly MySQL using InnoDB only tables and performing complex # queries with few connections. # # MySQL programs look for option files in a set of # locations which depend on the deployment platform. # You can copy this option file to one of those # locations. For information about these locations, see: # http://dev.mysql.com/doc/mysql/en/option-files.html # # In this file, you can use all long options that a program supports. # If you want to know which options a program supports, run the program # with the "--help" option. # # More detailed information about the individual options can also be # found in the manual. # # # The following options will be read by MySQL client applications. # Note that only client applications shipped by MySQL are guaranteed # to read this section. If you want your own MySQL client program to # honor these values, you need to specify it as an option during the # MySQL client library initialization. # [client] #password = [your_password] port = 3306 socket = /tmp/mysql.sock # *** Application-specific options follow here *** # # The MySQL server # [mysqld] # generic configuration options port = 3306 socket = /tmp/mysql.sock # back_log is the number of connections the operating system can keep in # the listen queue, before the MySQL connection manager thread has # processed them. If you have a very high connection rate and experience # "connection refused" errors, you might need to increase this value. # Check your OS documentation for the maximum value of this parameter. # Attempting to set back_log higher than your operating system limit # will have no effect. back_log = 50 # Don't listen on a TCP/IP port at all. This can be a security # enhancement, if all processes that need to connect to mysqld run # on the same host. All interaction with mysqld must be made via Unix # sockets or named pipes. # Note that using this option without enabling named pipes on Windows # (via the "enable-named-pipe" option) will render mysqld useless! #skip-networking # The maximum amount of concurrent sessions the MySQL server will # allow. One of these connections will be reserved for a user with # SUPER privileges to allow the administrator to login even if the # connection limit has been reached. max_connections = 100 # Maximum amount of errors allowed per host. If this limit is reached, # the host will be blocked from connecting to the MySQL server until # "FLUSH HOSTS" has been run or the server was restarted. Invalid # passwords and other errors during the connect phase result in # increasing this value. See the "Aborted_connects" status variable for # global counter. max_connect_errors = 10 # The number of open tables for all threads. Increasing this value # increases the number of file descriptors that mysqld requires. # Therefore you have to make sure to set the amount of open files # allowed to at least 4096 in the variable "open-files-limit" in # section [mysqld_safe] table_open_cache = 2048 # Enable external file level locking. Enabled file locking will have a # negative impact on performance, so only use it in case you have # multiple database instances running on the same files (note some # restrictions still apply!) or if you use other software relying on # locking MyISAM tables on file level. #external-locking # The maximum size of a query packet the server can handle as well as # maximum query size server can process (Important when working with # large BLOBs). enlarged dynamically, for each connection. max_allowed_packet = 16M # The size of the cache to hold the SQL statements for the binary log # during a transaction. If you often use big, multi-statement # transactions you can increase this value to get more performance. All # statements from transactions are buffered in the binary log cache and # are being written to the binary log at once after the COMMIT. If the # transaction is larger than this value, temporary file on disk is used # instead. This buffer is allocated per connection on first update # statement in transaction binlog_cache_size = 1M # Maximum allowed size for a single HEAP (in memory) table. This option # is a protection against the accidential creation of a very large HEAP # table which could otherwise use up all memory resources. max_heap_table_size = 64M # Size of the buffer used for doing full table scans. # Allocated per thread, if a full scan is needed. read_buffer_size = 2M # When reading rows in sorted order after a sort, the rows are read # through this buffer to avoid disk seeks. You can improve ORDER BY # performance a lot, if set this to a high value. # Allocated per thread, when needed. read_rnd_buffer_size = 16M # Sort buffer is used to perform sorts for some ORDER BY and GROUP BY # queries. If sorted data does not fit into the sort buffer, a disk # based merge sort is used instead - See the "Sort_merge_passes" # status variable. Allocated per thread if sort is needed. sort_buffer_size = 8M # This buffer is used for the optimization of full JOINs (JOINs without # indexes). Such JOINs are very bad for performance in most cases # anyway, but setting this variable to a large value reduces the # performance impact. See the "Select_full_join" status variable for a # count of full JOINs. Allocated per thread if full join is found join_buffer_size = 8M # How many threads we should keep in a cache for reuse. When a client # disconnects, the client's threads are put in the cache if there aren't # more than thread_cache_size threads from before. This greatly reduces # the amount of thread creations needed if you have a lot of new # connections. (Normally this doesn't give a notable performance # improvement if you have a good thread implementation.) thread_cache_size = 8 # This permits the application to give the threads system a hint for the # desired number of threads that should be run at the same time. This # value only makes sense on systems that support the thread_concurrency() # function call (Sun Solaris, for example). # You should try [number of CPUs]*(2..4) for thread_concurrency thread_concurrency = 8 # Query cache is used to cache SELECT results and later return them # without actual executing the same query once again. Having the query # cache enabled may result in significant speed improvements, if your # have a lot of identical queries and rarely changing tables. See the # "Qcache_lowmem_prunes" status variable to check if the current value # is high enough for your load. # Note: In case your tables change very often or if your queries are # textually different every time, the query cache may result in a # slowdown instead of a performance improvement. query_cache_size = 64M # Only cache result sets that are smaller than this limit. This is to # protect the query cache of a very large result set overwriting all # other query results. query_cache_limit = 2M # Minimum word length to be indexed by the full text search index. # You might wish to decrease it if you need to search for shorter words. # Note that you need to rebuild your FULLTEXT index, after you have # modified this value. ft_min_word_len = 4 # If your system supports the memlock() function call, you might want to # enable this option while running MySQL to keep it locked in memory and # to avoid potential swapping out in case of high memory pressure. Good # for performance. #memlock # Table type which is used by default when creating new tables, if not # specified differently during the CREATE TABLE statement. default-storage-engine = MYISAM # Thread stack size to use. This amount of memory is always reserved at # connection time. MySQL itself usually needs no more than 64K of # memory, while if you use your own stack hungry UDF functions or your # OS requires more stack for some operations, you might need to set this # to a higher value. thread_stack = 192K # Set the default transaction isolation level. Levels available are: # READ-UNCOMMITTED, READ-COMMITTED, REPEATABLE-READ, SERIALIZABLE transaction_isolation = REPEATABLE-READ # Maximum size for internal (in-memory) temporary tables. If a table # grows larger than this value, it is automatically converted to disk # based table This limitation is for a single table. There can be many # of them. tmp_table_size = 64M # Enable binary logging. This is required for acting as a MASTER in a # replication configuration. You also need the binary log if you need # the ability to do point in time recovery from your latest backup. log-bin=mysql-bin # binary logging format - mixed recommended binlog_format=mixed # If you're using replication with chained slaves (A->B->C), you need to # enable this option on server B. It enables logging of updates done by # the slave thread into the slave's binary log. #log_slave_updates # Enable the full query log. Every query (even ones with incorrect # syntax) that the server receives will be logged. This is useful for # debugging, it is usually disabled in production use. #log # Print warnings to the error log file. If you have any problem with # MySQL you should enable logging of warnings and examine the error log # for possible explanations. #log_warnings # Log slow queries. Slow queries are queries which take more than the # amount of time defined in "long_query_time" or which do not use # indexes well, if log_short_format is not enabled. It is normally good idea # to have this turned on if you frequently add new queries to the # system. slow_query_log # All queries taking more than this amount of time (in seconds) will be # trated as slow. Do not use "1" as a value here, as this will result in # even very fast queries being logged from time to time (as MySQL # currently measures time with second accuracy only). long_query_time = 2 # *** Replication related settings # Unique server identification number between 1 and 2^32-1. This value # is required for both master and slave hosts. It defaults to 1 if # "master-host" is not set, but will MySQL will not function as a master # if it is omitted. server-id = 1 # Replication Slave (comment out master section to use this) # # To configure this host as a replication slave, you can choose between # two methods : # # 1) Use the CHANGE MASTER TO command (fully described in our manual) - # the syntax is: # # CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>, # MASTER_USER=<user>, MASTER_PASSWORD=<password> ; # # where you replace <host>, <user>, <password> by quoted strings and # <port> by the master's port number (3306 by default). # # Example: # # CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306, # MASTER_USER='joe', MASTER_PASSWORD='secret'; # # OR # # 2) Set the variables below. However, in case you choose this method, then # start replication for the first time (even unsuccessfully, for example # if you mistyped the password in master-password and the slave fails to # connect), the slave will create a master.info file, and any later # changes in this file to the variable values below will be ignored and # overridden by the content of the master.info file, unless you shutdown # the slave server, delete master.info and restart the slaver server. # For that reason, you may want to leave the lines below untouched # (commented) and instead use CHANGE MASTER TO (see above) # # required unique id between 2 and 2^32 - 1 # (and different from the master) # defaults to 2 if master-host is set # but will not function as a slave if omitted #server-id = 2 # # The replication master for this slave - required #master-host = <hostname> # # The username the slave will use for authentication when connecting # to the master - required #master-user = <username> # # The password the slave will authenticate with when connecting to # the master - required #master-password = <password> # # The port the master is listening on. # optional - defaults to 3306 #master-port = <port> # Make the slave read-only. Only users with the SUPER privilege and the # replication slave thread will be able to modify data on it. You can # use this to ensure that no applications will accidently modify data on # the slave instead of the master #read_only #*** MyISAM Specific options # Size of the Key Buffer, used to cache index blocks for MyISAM tables. # Do not set it larger than 30% of your available memory, as some memory # is also required by the OS to cache rows. Even if you're not using # MyISAM tables, you should still set it to 8-64M as it will also be # used for internal temporary disk tables. key_buffer_size = 32M # MyISAM uses special tree-like cache to make bulk inserts (that is, # INSERT ... SELECT, INSERT ... VALUES (...), (...), ..., and LOAD DATA # INFILE) faster. This variable limits the size of the cache tree in # bytes per thread. Setting it to 0 will disable this optimisation. Do # not set it larger than "key_buffer_size" for optimal performance. # This buffer is allocated when a bulk insert is detected. bulk_insert_buffer_size = 64M # This buffer is allocated when MySQL needs to rebuild the index in # REPAIR, OPTIMIZE, ALTER table statements as well as in LOAD DATA INFILE # into an empty table. It is allocated per thread so be careful with # large settings. myisam_sort_buffer_size = 128M # The maximum size of the temporary file MySQL is allowed to use while # recreating the index (during REPAIR, ALTER TABLE or LOAD DATA INFILE. # If the file-size would be bigger than this, the index will be created # through the key cache (which is slower). myisam_max_sort_file_size = 10G # If a table has more than one index, MyISAM can use more than one # thread to repair them by sorting in parallel. This makes sense if you # have multiple CPUs and plenty of memory. myisam_repair_threads = 1 # Automatically check and repair not properly closed MyISAM tables. myisam_recover # *** INNODB Specific options *** # Use this option if you have a MySQL server with InnoDB support enabled # but you do not plan to use it. This will save memory and disk space # and speed up some things. #skip-innodb # Additional memory pool that is used by InnoDB to store metadata # information. If InnoDB requires more memory for this purpose it will # start to allocate it from the OS. As this is fast enough on most # recent operating systems, you normally do not need to change this # value. SHOW INNODB STATUS will display the current amount used. innodb_additional_mem_pool_size = 16M # InnoDB, unlike MyISAM, uses a buffer pool to cache both indexes and # row data. The bigger you set this the less disk I/O is needed to # access data in tables. On a dedicated database server you may set this # parameter up to 80% of the machine physical memory size. Do not set it # too large, though, because competition of the physical memory may # cause paging in the operating system. Note that on 32bit systems you # might be limited to 2-3.5G of user level memory per process, so do not # set it too high. innodb_buffer_pool_size = 2G # InnoDB stores data in one or more data files forming the tablespace. # If you have a single logical drive for your data, a single # autoextending file would be good enough. In other cases, a single file # per device is often a good choice. You can configure InnoDB to use raw # disk partitions as well - please refer to the manual for more info # about this. innodb_data_file_path = ibdata1:10M:autoextend # Set this option if you would like the InnoDB tablespace files to be # stored in another location. By default this is the MySQL datadir. #innodb_data_home_dir = <directory> # Number of IO threads to use for async IO operations. This value is # hardcoded to 8 on Unix, but on Windows disk I/O may benefit from a # larger number. innodb_write_io_threads = 8 innodb_read_io_threads = 8 # If you run into InnoDB tablespace corruption, setting this to a nonzero # value will likely help you to dump your tables. Start from value 1 and # increase it until you're able to dump the table successfully. #innodb_force_recovery=1 # Number of threads allowed inside the InnoDB kernel. The optimal value # depends highly on the application, hardware as well as the OS # scheduler properties. A too high value may lead to thread thrashing. innodb_thread_concurrency = 16 # If set to 1, InnoDB will flush (fsync) the transaction logs to the # disk at each commit, which offers full ACID behavior. If you are # willing to compromise this safety, and you are running small # transactions, you may set this to 0 or 2 to reduce disk I/O to the # logs. Value 0 means that the log is only written to the log file and # the log file flushed to disk approximately once per second. Value 2 # means the log is written to the log file at each commit, but the log # file is only flushed to disk approximately once per second. innodb_flush_log_at_trx_commit = 1 # Speed up InnoDB shutdown. This will disable InnoDB to do a full purge # and insert buffer merge on shutdown. It may increase shutdown time a # lot, but InnoDB will have to do it on the next startup instead. #innodb_fast_shutdown # The size of the buffer InnoDB uses for buffering log data. As soon as # it is full, InnoDB will have to flush it to disk. As it is flushed # once per second anyway, it does not make sense to have it very large # (even with long transactions). innodb_log_buffer_size = 8M # Size of each log file in a log group. You should set the combined size # of log files to about 25%-100% of your buffer pool size to avoid # unneeded buffer pool flush activity on log file overwrite. However, # note that a larger logfile size will increase the time needed for the # recovery process. innodb_log_file_size = 256M # Total number of files in the log group. A value of 2-3 is usually good # enough. innodb_log_files_in_group = 3 # Location of the InnoDB log files. Default is the MySQL datadir. You # may wish to point it to a dedicated hard drive or a RAID1 volume for # improved performance #innodb_log_group_home_dir # Maximum allowed percentage of dirty pages in the InnoDB buffer pool. # If it is reached, InnoDB will start flushing them out agressively to # not run out of clean pages at all. This is a soft limit, not # guaranteed to be held. innodb_max_dirty_pages_pct = 90 # The flush method InnoDB will use for Log. The tablespace always uses # doublewrite flush logic. The default value is "fdatasync", another # option is "O_DSYNC". #innodb_flush_method=O_DSYNC # How long an InnoDB transaction should wait for a lock to be granted # before being rolled back. InnoDB automatically detects transaction # deadlocks in its own lock table and rolls back the transaction. If you # use the LOCK TABLES command, or other transaction-safe storage engines # than InnoDB in the same transaction, then a deadlock may arise which # InnoDB cannot notice. In cases like this the timeout is useful to # resolve the situation. innodb_lock_wait_timeout = 120 [mysqldump] # Do not buffer the whole result set in memory before writing it to # file. Required for dumping very large tables quick max_allowed_packet = 16M [mysql] no-auto-rehash # Only allow UPDATEs and DELETEs that use keys. #safe-updates [myisamchk] key_buffer_size = 512M sort_buffer_size = 512M read_buffer = 8M write_buffer = 8M [mysqlhotcopy] interactive-timeout [mysqld_safe] # Increase the amount of open files allowed per process. Warning: Make # sure you have set the global system limit high enough! The high value # is required for a large number of opened tables open-files-limit = 8192
There are a couple of ways that I know of to create a theme demo site and I will outline them below.
So after outlining the options above I figured out the best way of setting out my themes was to use the Single WordPress Website option. This allows for ease of management and a great base to keep your templates for export when you need them to build client sites.
I will not only use this as my demo site, but i will use this to store my templates which i directly export and use to build my client sites reducing the time it takes to make a site.
You can also add and make modifications to these pages as you go to fix errors, add extra features and general improvements for future project. I find when i use a template for a client, I sometimes design or use a layout I really like so i can then add this back into my theme for future use.
If you follow these easy instructions below you can quickly build your demo site which allows for easy expansion and management.
This is straight forward and does not need notes except
These should be straight forward. I am using Divi as my Theme engine, but if you use another it should be fine.
We need to create a default menu and homepage for WordPress for all requests that do not have a proper page then at least we have a proper page that is displayed.
Notes
When I refer to a Theme, I actual mean a group of pages that have the same styling such as found on Divi Layouts by Elegant Themes
Each theme will require you to do the following (I will use example of Theme1). You can expand this to have more pages if you require.
Each theme needs its own custom menu and the instructions below show you how this should be done. Again I will use Theme1 as an example.
Repeat this for each theme you want to add. You can create the layouts on the fly in the demo site but will have to use a plugin (How To Clean Up Your WordPress Media Library | WP Engine / Media Cleaner – Clean & Optimize Space – WordPress plugin | WordPress.org ) to cleanup unwanted images after you finish or you have a separate development site.
Notes
Whether you have built you own layouts or used ones from Elegant themes I recommend reading the following about setting out the actual content.
The blog layouts in the Divi themes can be a good source of a standard clean page.
020 7123 456 07747 123456 no-reply@qwdemos.com QuantumWarp House, London SW1A 1AA QuantumWarp House Easy Street Westminster London SW1A 1AA United Kingdom
Not all clients send enough information and I have found that a lot of Divi Themes look nice but can be a bit impractical to use for my clients so I need to make alterations to them first before I can even use them.
Follow the steps below for each of the Pages/Layouts to make them ready to use for your clients:
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d2483.64596804941!2d-0.1440786842302416!3d51.501363979634085!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x48760520cd5b5eb5%3A0xa26abf514d902a7!2sBuckingham%20Palace!5e0!3m2!1sen!2suk!4v1639323812962!5m2!1sen!2suk" width="100%" height="450" style="border:0;display:block;" allowfullscreen="" loading="lazy" ></iframe>
style="border:0;display:block;filter:grayscale(100%);"
style="border:0;display:block;filter:grayscale(100%) invert(92%) contrast(83%);"
Now you have done all of this hard work you don't want other people stealing your bandwidth so you need to control who can put your site in an iframe and this can be done by several options, some old, some new, but extensively the hosting server tells the client if it can use the website in an iframe. This behaviour all works on the browser or software at the other end respecting these directives.
The options I outline below can usually be managed by decent software such as W3C Total Cache, but there is no harm in doing it manually.
CSP allows you to control how the browser behaves with your code remotely, and locally. You can tell the browser not to execute scripts on a page or not to embed the content in and iframe. Not allowing your content to be embedded in an iframe is quite obvious, but why would you want to stop your own scripts from running? This feature prevents scripts that have been maliciously implanted from running by only allowing scripts that you want to be run. The rules can be specified a lot more precisely, but this is just a simple example.
These are some examples of the .htaccess rules. You only need to specify one.
<IfModule mod_headers.c> ## Allow embedding from sitea.com or siteb.com including sub-domains using any protocol Header set Content-Security-Policy "frame-ancestors 'self' *.sitea.com *.siteb.com" ## Allow embedding from sitea.com or siteb.com including sub-domains using only HTTPS protocol Header set Content-Security-Policy "frame-ancestors 'self' https://*.sitea.com https://*.siteb.com" ## Allow embedding from example.org, example.com, store.example.com using only HTTPS protocol Header set Content-Security-Policy "frame-ancestors 'self' https://example.org https://example.com https://store.example.com;" </IfModule>
Content-Security-Policy
(CSP) frame-ancestors
directive specifies valid parents that may embed a page using <frame>
, <iframe>
, <object>
, or <embed>
.frame-ancestors
allows you to specify what parent source may embed a page. This differs from frame-src
, which allows you to specify where iframes in a page may be loaded from.host-source
and the iframe is loaded from an https
URL, the URL for the page loading the iframe must also be https
, per the Does URL match expression in origin with redirect count? section of the CSP spec.Header add Content-Security-Policy "default-src 'self';"
You can control the X-Frame-Options headers in either .htaccess or PHP but I will use .htaccess code here because it is easier to implement and is not script dependent.
The .htaccess code below uses the X-Frame-Options and gives the same effect as using ALLOW-FROM but without using this obsolete command.
# Conditional X-Frame-Options for iframe Embedding Control <If "%{HTTP_REFERER} == 'https://www.content-site.com/' || %{HTTP_REFERER} == 'https://www.sitea.com/' || %{HTTP_REFERER} == 'https://www.siteb.com/'"> <IfModule mod_headers.c> Header always unset X-Frame-Options </IfModule> </If> <Else> <IfModule mod_headers.c> Header always append X-Frame-Options SAMEORIGIN </IfModule> </Else>
Header always append X-Frame-Options "SAMEORIGIN"
Header always append X-Frame-Options "ALLOW-FROM https://www.sitea.com/"
RewriteCond %{HTTP_HOST} = www.askapache.com RewriteCond %{REMOTE_ADDR} = 8.8.8.8
<If "%{HTTP_HOST} == 'foo'"> # configuration for foo </If> <Else> # default configuration </Else>
<IfModule mod_headers.c> <If "%{HTTP:X-Requested-From} == 'mobileapp'"> Header unset X-Frame-Options </If> <Else> Header set X-Frame-Options SAMEORIGIN </Else> </IfModule>
header('X-Frame-Options: SAMEORIGIN');
remove_action('login_init', 'send_frame_options_header');
# Extra Security Headers <IfModule mod_headers.c> Header set X-XSS-Protection "1; mode=block" Header always append X-Frame-Options SAMEORIGIN Header set X-Content-Type-Options nosniff </IfModule>
<IfModule mod_headers.c> Header always append X-Frame-Options SAMEORIGIN </IfModule> Header always unset X-Frame-Options
No matter if you use a plugin or manually create the rules in your .htaccess they should look something like this:
<IfModule mod_headers.c> Header always set Strict-Transport-Security "max-age=31536000" Header set X-XSS-Protection "1; mode=block" Header set X-Content-Type-Options "nosniff" Header set Referrer-Policy "no-referrer-when-downgrade" Header set Content-Security-Policy "frame-ancestors 'self' *.sitea.com *.siteb.com" #Header set Content-Security-Policy "frame-ancestors 'self' https://*.sitea.com https://*.siteb.com" #Header set Content-Security-Policy "frame-ancestors 'self' https://example.org https://example.com https://store.example.com;" </IfModule>
Content-Security-Policy
examples for reference.Content-Security-Policy
does not define the protocol of connections allowed. This means that both HTTP and HTTPS are allowed but because HSTS is on, all incoming HTTP connections must be upgraded to HTTPS.These are somes task that might need doing after you have built all of your Theme pages.
You have built all of your Theme Demos, the last thing you have to do is:
These are my notes on using and configuring my APC Smart-UPS SMT1500IC 1500VA with SmartConnect.
apcupsd
installed on a raspberry pi connected to my APC ups via usb. Each of my devices have a bash script that polls the raspberry pi for the time remaining on the battery. Each is set to shut down at different times keeping the most important devices running as long as possible.shutdown.exe -m \\server -s -t 15
When you initially setup the UPS and you come to the install date, use only the arrow keys to configure the date as pressing enter accepts the date and sets it. This can be awkward to change. This does not affect any of the performance of the UPS but does change the predicted fail date of the battery which is about 4.5+ years.
Do not have any kit connected as I am not sure if this will cause any issue.
How to Update Battery Date for Smart UPS during Battery Insertion - YouTube
This example shows the procedure using a rack mount UPS, the only difference is that the battery connection for my UPS is at the back, the 'Battery Tab'
These are the official guides from APC.
The reason they are no good is that they tell you to go to the "Install New Battery" from the configuration menu, but this does not exist.
I have not used this to change my 'Battery Installation Date' but I cant see why it will not work.
NB: This method does not have an option to change the day, only the month and year.
Minimum Glazing Specs you should have
As standard, most double glazing should be supplied with argon cavity gas, at least 1 low-e coating and a warm edge spacer.
- Warm Heat Bar
- Coated Float Pane : Low E (emissivity) Glass / Pilkington K glass (is Low E Glass) / Planitherm (is Low E Glass)
- Argon filled (krypton is better)
My Choice
- Planitherm Confort Glass
- Planitherm Comfort Glass is the best glass choice for most houses
- OuterPane: 6.8mm STADIP SILENCE (2 sheets of glass with laminate in the middle)
- Inner Pane: 4mm PLANITHERM TOTAL+ (like K glass, this is also called the floating pane)
- Cavity: 16mm | Argon gas filled | Warm edge spacer (cavity might be a bit wider on 28mm cassette 28 - 6.8 - 4 = 17.2mm)
- Comfort | Planitherm
- Planitherm Glass Technical Specs (PDF)
- Frame
- Profile 22 - 5 baffles ???
- Rehow - 3 baffles ???
- Windows
- Full 90 degree openers
- Furniture
- Brushed Chrome or Satin Finish ???
This is the research I have done to decide what new type of windows I should put in my house.
- Sound Reduction
- 4mm+6mm: Domestic windows are typically 4-6mm thick. It follows that the thicker the glass, the better the noise insulation but it is also important to note that different glass thicknesses reduce different noise frequencies. So, if your double-glazed unit has one pane of glass at 4mm thick and one at 6mm thick, this will reduce noise across a wider frequency range than if they were the same thickness.
- Gases
- Argon (Krypton is better for price)
- Correct Spacing
- To get the maximum benefit from your double glazing, the gaps between the panes of glass should be 16mm and the gap between the two glass panes should be filled with argon gas, which adds another layer of heat insulation. If the gap is reduced then the thermal performance is reduced, unless you use a very expensive gas such as krypton.
- In a 28mm cassette, triple glazing is worse than double glazing because the minimum gap between the panes is violated.
- Triple Glazing:
- is only really needed in extreme conditions.
- is best in a 32mm cassette
- is a lot more expensive
Triple Glazing Vs Double Glazing
4mm / 6mm
Different Types of Glass
General
Gas Types
Warm Edge / Warm Heat Bar
Suppliers
Double Glazing Trim
Default name for Zgemma H2S http://zgemmah2s/
Others can be found at here and then:
- Spoiler: Installation Step 1 Getting ready for WooshBuild Infinity
- Spoiler: Select the make of your box from this list and then the model
- Spoiler AirDigital (Zgemma)
Zgemmas are made by AirDigital
Get firmware here : openATV Nightly Downloads - Zgemma H2S
Folowups
Notes
This is needed so things like FTP and remote Webif will work.
Notes
adduser admin -h /dev/null -H -s /bin/false -G root userdel newuser
I want to use my Webif remotely so i need to do the following
Notes
Sometimes the USB device that the Zgemma uses is not set correctly. In days pas this could be quite a manually task changing all of the mounts but this is now easy.
This is an old way of fixing the HDD issue but might be useful for a reference.
You get error warnings on your Zgemma H.S2 running Wooshbuild that there is no free space on /hdd/movies/ or other such locations on the hdd when there is actually free space. This error is common in the IPTV application.
Cause
This is caused by
Solution
All apps seem to be hardcoded to use the /media/hdd/ mount
Notes
not here yet
opkg install http://wbuildx.co.uk/setup.ipk
Notes
The version of e2iPlayer that Wooshbuild installs is too old and does not have some of the update options so this plugin needs to be updated. The instructions below assume you have used Wooshbuild rather than a complete vanilla OpenAtv install.
Notes
This requires e2iPlayer to be installed because it is a plugin of e2iPlayer rather than a standalone OpenAtv extension.
wget --no-check-certificate "https://gitlab.com/Rgysoft/iptv-host-e2iplayer/-/archive/master/iptv-host-e2iplayer-master.zip" -O /tmp/iptv.zip && unzip /tmp/iptv.zip -d /tmp/ && cp -rf /tmp/iptv-host-e2iplayer*/IPTVPlayer /usr/lib/enigma2/python/Plugins/Extensions
Notes
Install the plugin from Wooshbuild plugins feed and set your account details.
Notes
I have been trying to install wooshbuild infinity on my h.2s with satellite for my live channels but during the setup it always crashed just after when you select 'do you only want to see FreeSAT channels'.
Solution
I dont know if this is better or worse using this when watching streams, however it appears that it needs installing.
opkg update && opkg install enigma2-plugin-extensions-kodi
this notes are in progress + take my notes from my virtual box tutoaril as they will share with this alomost
These are a collection of notes for newbies. I point to other peoples work and highlight the main points.
Use the MSA (Magic Shadow Archiver) file format as it stores disk geometry and other things which can get around some weak disk protections.
This is a modern Windows based disk acquisition and image file handler. It will handle some copy protections I believe but not all, for that you will need a KyroFlux device.
Their instructions are straight forward and I guide you to them for further advise.
This is the simplest method to image disks using DOS but is an old way of doing it becasue of the use of DOS. Also makedisk cannot handle copy protected disks.
makedisk /read /auto /msa /slow TEST.ST (this creates an image from a floppy disk) makedisk /write c:\test\TEST.MSA /auto (this writes an image to a floppy disk)
Pasti can handle protected disks and other images but you need a real ST to use this software.
This can handle a wide variety of disks including Atari ST. I am not sure how well it handles copy proteced disks.
PC 720KB disk (79 Tracks ??) ST 720KB disk (80 Sectors/Tracks Cylinders 9, Sides 2) ST 720KB : track=80, head=2, sector=9, block=512 PC 1.44MB (18 Sectors/Tracks, Cylinders 80, Sides 2)
format a: /f:720 format a: /t:80 /n:9
Example DD command dd if=/dev/floppy0 of=mydisk.img bs=1M
open terminal sudo apt-get install kfloppy [enter password] reboot (optional?) open up terminal sudo kfloppy [enter password] select option including primary drive click format
ufiformat -f 720 /dev/sda
sudo /sbin/mkdosfs -I /dev/sdj -n MYFLOPPY
These are my instructions on configuring my HP 2015n printer to invisibly (to applications) print 2 pages on a single sheet on a single piece of paper.
These instructions might work on different printers as long as they have the feature set in their driver.
These settings will make the printer scale the full pages and print them 2 a page.
Notes
Setting up a new printer with these options as the default settings will make your lifer easier rather that having to select these options each time you print or reverting the defaults when you are finished.
When I say setup another printer I mean we will use the same physical printer but install another instance of the printer which we can then configure as required.
So follow one of the tutorials below
This all started because I printout my PayPal receipts and because of their formatting can take several sheets of paper. Often the last sheet would just have 1 word on it.
I started by manually just printing the first 2 pages, but this is time consuming so I wrote a macro just to print the first 2 pages of the PayPal receipt to the default printer so I could achieve the same thing but with 1 button click which is what I will show you how to do below.
Then I moved on and configured my printer to print 2 pages on every sheet. So instead of an average of 3 A4 pages every receipt I now just use 1. This has the added advantage that some times a receipt is 1 page and sometimes it is 2 pages so no more paper that what is absolutely needed is used.
I then also created a memo style in Outlook with the margins reduced. (Optional)
This is best solution for printing PayPal Receipts.
See Print 2 full pages on single sheet of paper with HP a printer | QuantumWarp
To get this to work there are several parts, building the macro (which is done for you), installing the macro and then creating a button in Quick Access Toolbar to run it.
' Outlook 2016/2019 PayPal Receipt Printing - Only print pages 1 and 2 Sub PayPal_Receipt_Printing() SendKeys "%" SendKeys "FPR" SendKeys "%{S}" SendKeys "1-2" SendKeys "{ENTER}" DoEvents SendKeys "{NUMLOCK}{NUMLOCK}" End Sub
The code below worked for a while but recently stopped working after a Windows update but I am leaving it here for reference because there might old versions of office this is needed for and I can see what I changed to get it to work.
' Outlook 2016/2019 PayPal Receipt Printing - Only print pages 1 and 2 Sub PayPal_Receipt_Printing() SendKeys "%FPR" SendKeys "%S" SendKeys "1-2" SendKeys "{ENTER}" DoEvents SendKeys "{NUMLOCK}{NUMLOCK}" End Sub
How I fixed this
Code explained
Remembering that this script will use your default printer, do a test print and then you are done.
The rest of this article is for reference.
The NumLock would always turn off after running the script no matter what. These are my notes on resolving this issue.
When you use SendKeys the NumLock is turned off due to a bug in Visual Basic.
I found these towards the end of my research and they pretty much the best way of fixing this issue.
Executing two or more SendKeys statements in a row results in turning off the NumLock key. This problem may also affect the CapsLock and ScrollLock keys.
If you look in the script above you can see the following code taken from SendKeys is messing with my NumLock key via VBA code in Access form - Stack Overflow
DoEvents SendKeys "{NUMLOCK}{NUMLOCK}"
This solution seems to work really well and perhaps can be expanded for Caps Lock and Scroll Lock if needed.
I spent quite a bit of time trying this but could not get it to work so I am including my notes and research here for future reference.
The code below I managed to get to sense when a key was pressed down and shows how to use the High/Low bit thing by using Hex codes
' Get Numlock status Private Const VK_NUMLOCK = &H90 Private Const VK_SCROLL = &H91 Private Const VK_CAPITAL = &H14 Private Declare PtrSafe Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Long Private Function KeyDown(ByVal vKey As Long) As Boolean KeyDown = GetAsyncKeyState(vKey) And &H8001 End Function Sub Test_Key_down() If KeyDown(vbKeyNumlock) Then MsgBox "The NumLock key is pressed down!" End Sub
Notes
I never tried this option as it looked very complicated and I do not want to learn VB.
These instructions are for CWPpro but will work for the most part with the free version of Control Web Panel. For the yearly cost of the Pro version it is worth paying the $12 and trying the full software out from the start. This will also support the project.
For reference I used:
Following these instructions will take around 5 Hours to complete and this assumes you have built your Windows 10 Pro PC.
I do not cover every aspect because I am not a professional but this should be a good baseline. But what it does cover is:
Just follow the guide through from beginning to end and everything will work. I built the guide as I figured things out.
It is easier to get these things together before you start.
You can use your own Virtual Machine server if you have one. My preference is VirtualBox because it is free but VMWare should do just fine.
Not everyone will use a RAID, but should. A few simple checks to make sure everything is correct is a good idea.
The information below is for standard RAIDs found on Desktop PCs and not ones on ZFS or anything funky like that.
These are my settings for VirtualBox but you might want to modify them slightly which will be fine.
If a setting is not mentioned or is crossed out below, leave it as default.
Using the Guided or expert mode will give the same outcome.
There is currently a bug with rebooting a VM when running in EFI mode with more than 1 CPU. See notes below.
CWP/CentOS works with each type of VirtualBox Start Up. You should look into which one suits you best.
I use Normal until everything is setup and then use Headless when it goes into production.
We now need to finish configuring the VM so it performs better with CentOS Linux.
Notes
VBoxManage startvm "{VMName}" --type headless VBoxManage startvm Debian --type headless VBoxHeadless --startvm "{VMName}" VBoxHeadless --startvm Debian
00:09:27.886256 Changing the VM state from 'RUNNING' to 'GURU_MEDITATION' 00:09:27.886303 Console: Machine state changed to 'GuruMeditation' 00:09:27.886560 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 00:09:27.886561 !! 00:09:27.886562 !! VCPU1: Guru Meditation 1155 (VINF_EM_TRIPLE_FAULT) 00:09:27.886645 !! 00:09:27.886652 !! Skipping ring-0 registers and stack, rcErr=VINF_EM_TRIPLE_FAULT 00:09:27.886660 !! 00:09:27.886660 !! {mappings, <NULL>} 00:09:27.886661 !! 00:09:27.886670 !! 00:09:27.886670 !! {hma, <NULL>} 00:09:27.886671 !! 00:09:27.886673 Hypervisor Memory Area (HMA) Layout: Base 00000000a0000000, 0x02800000 bytes 00:09:27.886678 00000000a1129000-00000000a113a000 000000000db10000 ffffdf829833e000 LOCKED alloc once (PGM_PHYS) 00:09:27.886684 00000000a111b000-00000000a1129000 000000000b690000 ffffdf829b47d000 LOCKED alloc once (VMM) 00:09:27.886690 00000000a110d000-00000000a111b000 000000000b680000 ffffdf829b46f000 LOCKED alloc once (VMM) 00:09:27.886696 00000000a030c000-00000000a110d000 0000000009d60000 ffffb4753b800000 LOCKED alloc once (PGM_PHYS) 00:09:27.886700 00000000a0279000-00000000a030c000 0000000009ac0000 ffffdf8295010000 LOCKED alloc once (PGM_POOL) 00:09:27.886706 00000000a0278000-00000000a0279000 0000000009ab0000 ffffdf8290f60000 LOCKED alloc once (CPUM_CTX) 00:09:27.886710 00000000a0038000-00000000a0278000 0000000009870000 ffffb4753b200000 LOCKED Heap 00:09:27.886715 00000000a0023000-00000000a0038000 00000000095a0000 ffffdf8290f4a000 LOCKED VMCPU 00:09:27.886720 00000000a000e000-00000000a0023000 0000000009580000 ffffdf8290f34000 LOCKED VMCPU 00:09:27.886724 00000000a0000000-00000000a000e000 0000000009570000 ffffdf8290f24000 LOCKED VM 00:09:27.886729 !! 00:09:27.886729 !! {cpumguest, verbose} 00:09:27.886731 !!
vboxmanage startvm <vm-uuid> --type emergencystop
I will install CentOS using EFI but pay attention to the reset bug
CentOS 7 (Minimal) is the recommended version of the OS to use when installing CWP. It should be also noted there is no uninstaller but you should never need one.
nmtui or nmtui edit enp0s3 (might work)
hostname server.mydomain.com
yum -y install wget
yum -y update
reboot
Notes
Now your VM has CentOS insatlled we can proceed and install CWP.
CWP installer can run more than 30 minutes because it needs to compile Apache and php from source but might be a lot quicker on modern PCs.
cd /usr/local/src wget http://centos-webpanel.com/cwp-el7-latest sh cwp-el7-latest -restart yes --phpfpm 7.4The --phpfpm 7.4 switch did not work for me.
############################# # CWP Installed # ############################# Go to CentOS WebPanel Admin GUI at http://SERVER_IP:2030/ http://13.13.13.13:2030 SSL: https://13.13.13.13:2031 --------------------- Username: root Password: ssh server root password MySQL root Password: xxxxxxxxxxxx ######################################################### CentOS Web Panel MailServer Installer ######################################################### SSL Cert name (hostname): server.mydomain.com SSL Cert file location /etc/pki/tls/ private|certs ######################################################### Visit for help: www.centos-webpanel.com Write down login details and press ENTER for server reboot! Please reboot the server! Reboot command: shutdown -r now
shutdown -r now
Notes
[ 1.926356] [drm:vmw_host_log [vmwgfx]] *ERROR* Failed to send host log messa [ 1.926494] [drm:vmw_host_log [vmwgfx]] *ERROR* Failed to send host log messa
package-cleanup --oldkernels --count=1
installonly_limit=2
Although you don't have to create an account for the Primary Domain on the server for it to work, it makes sense too unless you have a reason otherwise.
Now that CWP is installed we need to configure it
Ypu will now see some errors as shown in the picture below (or similiar)
Your Hostname is: server.mydomain.com and it resolves to IP: (ERROR: You don't have a valid hostname set!)
Notes
TYPE=Ethernet PROXY_METHOD=none BROWSER_ONLY=no BOOTPROTO=dhcp DEFROUTE=yes IPV4_FAILURE_FATAL=no IPV6INIT=no IPV6_AUTOCONF="yes" IPV6_DEFROUTE="yes" IPV6_FAILURE_FATAL="no" IPV6_ADDR_GEN_MODE="stable-privacy" NAME=enp0s3 UUID=adfa1901-1eee-4cee-b2c4-62a2bf6323f4 DEVICE=enp0s3 ONBOOT=yes IPADDR=192.168.1.11 PREFIX=24 GATEWAY=192.168.1.1 DNS1=192.168.1.1
In this section we will complete the setup of CWP now we have got rid of the errors.
Notes
For this you need a real domain (mydomain.com) and your public static Ip (13.13.13.13) from earlier.
Notes
ns1.mydomain.com resolves to ; <<>> DiG 9.11.4-P2-RedHat-9.11.4-26.P2.el7_9.5 <<>> A ns1.mydomain +short @8.8.8.8 ;; global options: +cmd ;; connection timed out; no servers could be reached ns2.mydomain.com resolves to
This is cause by one or both of these:
ns1.centos-webpanel.com resolves to 54.36.136.192 ns2.centos-webpanel.com resolves to 198.27.104.41 ns1.centos-webpanel.com 127.0.0.1 ns2.centos-webpanel.com 127.0.0.1
Now that the name servers have been changed, the Primary user account needs to be updated to reflect the change
Notes
server 14400 IN A 31.125.252.137 ns1.mydomain.com. 14400 IN A 31.125.252.137 ns2.mydomain.com. 14400 IN A 31.125.252.137
These must be changed at your ISP or IP provider. These records allow your server domain to be worked out from the IP address.
A good rDNS is better for your server reputation and will allow more successful delvery of email.
Plusnet/BT/UK ISPs: By default thier IPs from ISP are on the Spamhaus 'Policy Block List' because it should not be sending emails. So you might need to contact your ISP to have the Ip removed from the list. I did manage to remove myself from the SPAMHaus PBL list byt looking up my IP and then expanding the message at the bottom, fill in the required information and soon after I was removed for the list. This might not be the case for all ISPs.
CentOS Mostly Used Ports - Control WebPanel Wiki
Notes
Forbidden Rejected request from RFC1918 IP to public server address
The CWP server is now present on the internet.
Cgroups allow you to limit resources per user — such as CPU %, system memory, network bandwidth, or combinations of these resources. You have to create a Cgroup and then assign it in the package. This is good for preventing server abuse byt the user or a hacker. You have to create a Cgroup before it can be assigned to a package or user so we will do this before creating our packages.
Notes
Setup the following packages. These are not mandatory but are a good baseline for you to start from and make managing your server easier. If you are migrating from cPanel I think the packages might be created automatically.
Packages are found at: Packages --> Packages
You now have seperate packages for your company and client accounts.
Notes
The feature manager allows you to filter / block modules for use in the user module.
Feature Manager | Control-WebPanel Documentation
User Accounts --> Features,Themes,Languages --> Feature Manager
I think the accounts have all features available until you assign a feature set.
You can assign these features to an account or package. I will always choose to do these things by packages because it is the way I have done it in cPanel.
When you select these options you might not currently have all of the servers or things installed. Select your options as if they were so they match up when you later add the required features.
You now have seperate feature sets for your company and client accounts.
Notes
This is a very useful thing to have. It is just a simple account you can use to see what clients see.
Notes
/usr/local/cwp/php71
Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.
Jun 27 11:05:04 server apachectl: SSLProtocol: Illegal protocol 'TLSv1.3'
So Apache failing to load is most likely becasue I added TLS1.3 and HTTP2 with the Mystery Data scripts and in particular the TLS1.3 protocol is not compatible with Apache. This might of only just been added or it is some other incompatiblilty.
To fix the reamin Apache issue I reran How to Enable TLS 1.3 in Apache on CWP- Control Web Panel Centos 7 Centos 8 EL7 El8 | Mystery Data
Links
This is mostly setup but for a couple of settings in the FTP manager
Notes pure-ftpd Setup Passive FTP Ports - Control WebPanel Wiki
Configuring the PHP service is good for security and performance.
disable_functions = "" --> "system,passthru,popen,exec,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,highlight_file,escapeshellcmd,define_syslog_variables,posix_uname,posix_getpwuid,apache_child_terminate,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,escapeshellarg,posix_uname,ftp_exec,ftp_connect,ftp_login,ftp_get,ftp_put,ftp_nb_fput,ftp_raw,ftp_rawlist,ini_alter,ini_restore,inject_code,syslog,openlog,define_syslog_variables,apache_setenv,mysql_pconnect,eval,phpAds_XmlRpc,phpAds_remoteInfo,phpAds_xmlrpcEncode,phpAds_xmlrpcDecode,xmlrpc_entity_decode,fp,fput,shell_exec,apache_get_modulesi" expose_php = On --> Off max_execution_time = 30 --> 180 max_input_time = 60 --> 180 max_input_vars = 4000 memory_limit = 128M --> 256M post_max_size = 8M --> 64M upload_max_filesize = 2M --> 64M date.timezone = "Europe/London"
zlib.output_compression = Off error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT --> E_ALL & ~E_NOTICE ; http://php.net/track-errors ;track_errors = Off ; http://php.net/html-errors ;html_errors = On ; http://php.net/register-argc-argv register_argc_argv = Off ; http://php.net/allow-url-fopen (I have this on all the time, but should it be off by default) allow_url_fopen = On
Notes
max_execution_time = 120 max_input_time = 60 max_input_vars = 1000 memory_limit = 128M post_max_size = 64M upload_max_filesize = 64M
# # This group is read both by the client and the server # use it for options that affect everything # [client-server] # # include *.cnf from the config directory # !includedir /etc/my.cnf.d
[client] default-character-set = utf8mb4 [mysql] default-character-set = utf8mb4 [mysqld] collation-server = utf8mb4_unicode_ci init-connect = 'SET NAMES utf8mb4' character-set-server = utf8mb4
Notes
Default configuration and explanation of the settings mysqld --no-defaults --verbose --help or, on a running 10.1+ server, by executing SELECT variable_name, default_value FROM information_schema.system_variables ORDER BY variable_name
mysqld --verbose --help mysqladmin variables
Postfix and Dovecot are both required for a full email system and should already be running and this is why you are already (if configured) getting server notification emails.
/usr/local/cwpsrv/htdocs/resources/conf/dns/bind/zones/
@ 14400 IN TXT "v=spf1 +a +mx +ip4:%ip% ~all" --> @ 14400 IN TXT "v=spf1 +a +mx +ip4:%ip% -all"
/usr/local/cwpsrv/htdocs/resources/conf/dns/bind/zones/custom.tpl
Notes
; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename mail.add_x_header = On
This has to be done here so all of your new accounts dont get this vestigial subdomain.
It is my opinion this is not really used by anything anymore and that is why this is optional.
/usr/local/cwpsrv/htdocs/resources/conf/dns/bind/zones/custom.tpl
cwp 14400 IN A %ip%
If you are running a network firewall such as pfSense, then do the Country Blocking in that device, so all network devices can benefit from that single ruleset but keep the lookup service enabled here to allow for IP to country lookups
Notes
Notes
/usr/local/apache/conf.d/ssl.conf
The more resources you install the more resources you use. I dont know if you need to install each one of these.
Apache Error Log (sitea) [Thu Dec 23 19:47:52.977523 2021] [proxy_fcgi:error] [pid 4659:tid 139985935795968] [client 192.168.1.1:58256] AH01071: Got error 'PHP message: PHP Fatal error: [snuffleupagus][0.0.0.0][disabled_function][drop] Aborted execution on call of the function 'ini_set', because its argument '$varname' content (display_errors) matched a rule in /home/mydomain/public_html/sitea/wp-includes/load.php on line 465' [Thu Dec 23 19:47:53.157871 2021] [proxy_fcgi:error] [pid 4659:tid 139985935795968] [client 192.168.1.1:58256] AH01071: Got error 'PHP message: PHP Fatal error: [snuffleupagus][0.0.0.0][disabled_function][drop] Aborted execution on call of the function 'ini_set', because its argument '$varname' content (display_errors) matched a rule in /home/mydomain/public_html/sitea/wp-includes/load.php on line 465', referer: https://sitea.mydomain.com/ [Thu Dec 23 19:47:54.155940 2021] [proxy_fcgi:error] [pid 4659:tid 139985935795968] [client 192.168.1.1:58256] AH01071: Got error 'PHP message: PHP Fatal error: [snuffleupagus][0.0.0.0][disabled_function][drop] Aborted execution on call of the function 'ini_set', because its argument '$varname' content (display_errors) matched a rule in /home/mydomain/public_html/sitea/wp-includes/load.php on line 465' Apache Error Log (siteb) [Thu Dec 23 19:26:46.802401 2021] [proxy_fcgi:error] [pid 1642:tid 140310124496640] [client 192.168.1.1:49326] AH01071: Got error 'PHP message: PHP Warning: [snuffleupagus][0.0.0.0][config][log] It seems that you are filtering on a parameter 'var_array' of the function 'extract', but the parameter does not exists. in /home/mydomain/public_html/siteb/wp-includes/template.php on line 762PHP message: PHP Warning: [snuffleupagus][0.0.0.0][config][log] - 0 parameter's name: 'arg' in /home/mydomain/public_html/siteb/wp-includes/template.php on line 762PHP message: PHP Warning: [snuffleupagus][0.0.0.0][config][log] - 1 parameter's name: 'extract_type' in /home/mydomain/public_html/siteb/wp-includes/template.php on line 762PHP message: PHP Warning: [snuffleupagus][0.0.0.0][config][log] - 2 parameter's name: 'prefix' in /home/mydomain/public_html/siteb/wp-includes/template.php on line 762PHP message: PHP Warning: [snuffleupagus][0.0.0.0][config][log] It seems that you are filtering on a parameter 'var_array' of the function 'extract', but the parameter does not exists. in /home/mydomain/public_html/siteb/wp-includes/template.php on line 762PHP message: PHP Warning: [snuffleupagus][0.0.0.0][config][log] - 0 parameter's name: 'arg' in /home/mydomain/public_html/siteb/wp-includes/template.php on line 762PHP message: PHP Warning: [snuffleupagus][0.0.0.0][config][log] - 1 parameter's name: 'extract_type' in /home/mydomain/public_html/siteb/wp-includes/template.php on line 762PHP message: PHP Warning: [snuffleupagus][0.0.0.0][config][log] - 2 parameter's name: 'prefix' in /home/mydomain/public_html/siteb/wp-includes/template.php on line 762PHP message: PHP Warning: [snuffleupagus][0.0.0.0][config][log] It seems that you are filtering on a parameter 'var_array' of the function 'extract', but the parameter does not exists. in /home/mydomain/public_html/siteb/wp-includes/template.php on line 762PHP message: PHP Warning: [snuffleupagus][0.0.0.0][config][log] - 0 parameter's name: 'arg' in /home/mydomain/public_html/siteb/wp-includes/template.php on line 762PHP message: PHP Warning: [snuffleupagus][0.0.0.0][config][log] - 1 parameter's name: 'extract_type' in /home/mydomain/public_html/siteb/wp-includes/template.php on line 762PHP message: PHP Warning: [snuffleupagus][0.0.0.0][config][log] - 2 parameter's name: 'prefix' in /home/mydomain/public_html/siteb/wp-includes/template.php on line 762' [Thu Dec 23 19:26:53.844567 2021] [proxy_fcgi:error] [pid 1696:tid 140310174852864] [client 192.168.1.1:49334] AH01071: Got error 'PHP message: PHP Warning: [snuffleupagus][0.0.0.0][config][log] It seems that you are filtering on a parameter 'var_array' of the function 'extract', but the parameter does not exists. in /home/mydomain/public_html/siteb/wp-includes/template.php on line 762PHP message: PHP Warning: [snuffleupagus][0.0.0.0][config][log] - 0 parameter's name: 'arg' in /home/mydomain/public_html/siteb/wp-includes/template.php on line 762PHP message: PHP Warning: [snuffleupagus][0.0.0.0][config][log] - 1 parameter's name: 'extract_type' in /home/mydomain/public_html/siteb/wp-includes/template.php on line 762PHP message: PHP Warning: [snuffleupagus][0.0.0.0][config][log] - 2 parameter's name: 'prefix' in /home/mydomain/public_html/siteb/wp-includes/template.php on line 762PHP message: PHP Warning: [snuffleupagus][0.0.0.0][config][log] It seems that you are filtering on a parameter 'var_array' of the function 'extract', but the parameter does not exists. in /home/mydomain/public_html/siteb/wp-includes/template.php on line 762PHP message: PHP Warning: [snuffleupagus][0.0.0.0][config][log] - 0 parameter's name: 'arg' in /home/mydomain/public_html/siteb/wp-includes/template.php on line 762PHP message: PHP Warning: [snuffleupagus][0.0.0.0][config][log] - 1 parameter's name: 'extract_type' in /home/mydomain/public_html/siteb/wp-includes/template.php on line 762PHP message: PHP Warning: [snuffleupagus][0.0.0.0][config][log] - 2 parameter's name: 'prefix' in /home/mydomain/public_html/siteb/wp-includes/template.php on line 762PHP message: PHP Warning: [snuffleupagus][0.0.0.0][config][log] It seems that you are filtering on a parameter 'var_array' of the function 'extract', but the parameter does not exists. in /home/mydomain/public_html/siteb/wp-includes/template.php on line 762PHP message: PHP Warning: [snuffleupagus][0.0.0.0][config][log] - 0 parameter's name: 'arg' in /home/mydomain/public_html/siteb/wp-includes/template.php on line 762PHP message: PHP Warning: [snuffleupagus][0.0.0.0][config][log] - 1 parameter's name: 'extract_type' in /home/mydomain/public_html/siteb/wp-includes/template.php on line 762PHP message: PHP Warning: [snuffleupagus][0.0.0.0][config][log] - 2 parameter's name: 'prefix' in /home/mydomain/public_html/siteb/wp-includes/template.php on line 762' [Thu Dec 23 19:27:27.416398 2021] [proxy_fcgi:error] [pid 1696:tid 140310174852864] [client 192.168.1.1:49349] AH01071: Got error 'PHP message: PHP Warning: [snuffleupagus][0.0.0.0][config][log] It seems that you are filtering on a parameter 'var_array' of the function 'extract', but the parameter does not exists. in /home/mydomain/public_html/siteb/wp-includes/template.php on line 762PHP message: PHP Warning: [snuffleupagus][0.0.0.0][config][log] - 0 parameter's name: 'arg' in /home/mydomain/public_html/siteb/wp-includes/template.php on line 762PHP message: PHP Warning: [snuffleupagus][0.0.0.0][config][log] - 1 parameter's name: 'extract_type' in /home/mydomain/public_html/siteb/wp-includes/template.php on line 762PHP message: PHP Warning: [snuffleupagus][0.0.0.0][config][log] - 2 parameter's name: 'prefix' in /home/mydomain/public_html/siteb/wp-includes/template.php on line 762PHP message: PHP Warning: [snuffleupagus][0.0.0.0][config][log] It seems that you are filtering on a parameter 'var_array' of the function 'extract', but the parameter does not exists. in /home/mydomain/public_html/siteb/wp-includes/template.php on line 762PHP message: PHP Warning: [snuffleupagus][0.0.0.0][config][log] - 0 parameter's name: 'arg' in /home/mydomain/public_html/siteb/wp-includes/template.php on line 762PHP message: PHP Warning: [snuffleupagus][0.0.0.0][config][log] - 1 parameter's name: 'extract_type' in /home/mydomain/public_html/siteb/wp-includes/template.php on line 762PHP message: PHP Warning: [snuffleupagus][0.0.0.0][config][log] - 2 parameter's name: 'prefix' in /home/mydomain/public_html/siteb/wp-includes/template.php on line 762PHP message: PHP Warning: [snuffleupagus][0.0.0.0][config][log] It seems that you are filtering on a parameter 'var_array' of the function 'extract', but the parameter does not exists. in /home/mydomain/public_html/siteb/wp-includes/template.php on line 762PHP message: PHP Warning: [snuffleupagus][0.0.0.0][config][log] - 0 parameter's name: 'arg' in /home/mydomain/public_html/siteb/wp-includes/template.php on line 762PHP message: PHP Warning: [snuffleupagus][0.0.0.0][config][log] - 1 parameter's name: 'extract_type' in /home/mydomain/public_html/siteb/wp-includes/template.php on line 762PHP message: PHP Warning: [snuffleupagus][0.0.0.0][config][log] - 2 parameter's name: 'prefix' in /home/mydomain/public_html/siteb/wp-includes/template.php on line 762' [Thu Dec 23 19:27:58.554425 2021] [proxy_fcgi:error] [pid 1696:tid 140310174852864] [client 192.168.1.1:49350] AH01071: Got error 'PHP message: PHP Warning: [snuffleupagus][0.0.0.0][config][log] It seems that you are filtering on a parameter 'var_array' of the function 'extract', but the parameter does not exists. in /home/mydomain/public_html/siteb/wp-includes/template.php on line 762PHP message: PHP Warning: [snuffleupagus][0.0.0.0][config][log]
MAILTO=root@localhost to MAILTO=root
---------------------- Start Rootkit Hunter Scan ---------------------- Warning: Checking for prerequisites [ Warning ] The file of stored file properties (rkhunter.dat) does not exist, and should be created. To do this type in 'rkhunter --propupd'. Warning: WARNING! It is the users responsibility to ensure that when the '--propupd' option is used, all the files on their system are known to be genuine, and installed from a reliable source. The rkhunter '--check' option will compare the current file properties against previously stored values, and report if any values differ. However, rkhunter cannot determine what has caused the change, that is for the user to do. Warning: The command '/usr/sbin/ifdown' has been replaced by a script: /usr/sbin/ifdown: Bourne-Again shell script, ASCII text executable Warning: The command '/usr/sbin/ifup' has been replaced by a script: /usr/sbin/ifup: Bourne-Again shell script, ASCII text executable Warning: The command '/usr/bin/egrep' has been replaced by a script: /usr/bin/egrep: POSIX shell script, ASCII text executable Warning: The command '/usr/bin/fgrep' has been replaced by a script: /usr/bin/fgrep: POSIX shell script, ASCII text executable ----------------------- End Rootkit Hunter Scan -----------------------
[root@cwpserver /]# rkhunter --propupd [ Rootkit Hunter version 1.4.6 ] File created: searched for 176 files, found 131 [root@cwpserver /]#
System checks summary ===================== File properties checks... Files checked: 131 Suspect files: 0 Rootkit checks... Rootkits checked : 492 Possible rootkits: 0 Applications checks... All checks skipped The system checks took: 3 minutes and 11 seconds All results have been written to the log file: /var/log/rkhunter/rkhunter.log No warnings were found while checking the system. [root@cwpserver /]#
sshd: 192.168.1.0/24
sshd: ALL
ftpd: 192.168.1.0/24
ftpd: ALL
/usr/local/cwpsrv/conf.d/webmail.conf
# Disabled forced ssl, uncomment if you want to force ssl #if ($host != "localhost"){ # return 301 https://$host:2096$request_uri; #}
sh /scripts/mysql_pwd_reset
grep password /root/.my.cnf
Warning: mysqli_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES) in /usr/local/cwpsrv/htdocs/resources/admin/include/functions.php on line 0 Warning: mysqli_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES) in /usr/local/cwpsrv/htdocs/admin/admin/index.php on line 0 Trying to start mysql server, please wait! Try to restart CentOS Web Panel with command: sh /scripts/restart_cwpsrv **Check your MySQL root password in: /usr/local/cwpsrv/htdocs/resources/admin/include/db_conn.php and /root/.my.cnf Warning: mysqli_error() expects exactly 1 parameter, 0 given in /usr/local/cwpsrv/htdocs/admin/admin/index.php on line 0 Could not connect:
systemctl stop mysqld systemctl set-environment MYSQLD_OPTS="--skip-grant-tables" systemctl start mysqld mysql -u root
mysql> UPDATE mysql.user SET authentication_string = PASSWORD('MyNewPassword') WHERE User = 'root' AND Host = 'localhost'; mysql> FLUSH PRIVILEGES; mysql> quit
systemctl stop mysqld systemctl unset-environment MYSQLD_OPTS systemctl start mysqld
mysql -u root -p
Notes
[root@server ~]# sh /scripts/mysql_pwd_reset Enter the new root password (at least 8 chars). Or leave it empty if you would like to generate it. Or press CTRL+C to abort and do not touch it Enter MySQL root password:
/usr/local/cwpsrv/htdocs/resources/scripts/mysql_pwd_reset
/scripts/mysql_pwd_reset
/usr/local/cwpsrv/htdocs/resources/admin/include/db_conn.php /root/.my.cnf
grep password /root/.my.cnf
This is a safety measure so if the root account gets comprimised you can still get in with this account.
adduser backupuser
passwd backupuser
Notes
cut -d: -f1 /etc/passwd
cat /etc/passwd | awk -F: '{print $1}'
getent passwd
passwd <username>
set alert root@localhost to set alert youradmin@mydomain.com
<html><body bgcolor="#FFFFFF"></body></html>
<html><body bgcolor="#FFFFFF"></body></html>
<html><body bgcolor="#FFFFFF"></body></html>
We need to configure CWP to send error notifications and unless you know where to click this can be hidden.
You've received a new %level% notification: %subject% Here are the details: %message% %url%
It should be noted that currently CWP does not manage backup retentions (i.e. it does not delete any backups so they will keep growing in number). See the notes below for solution.
Notes
This is Linux's version of scheduled tasks (for us Windows users) and there are 2 pages that currently allow you to configure them throught the GUI. They both work on the same dataset which is confusing and hopefully these pages will get merged.
Check the time they run
I would have my crons run late at night probably after my backups. You check the time fit in with how you run your server and if you ar enot sure just leave themas they are for now.
You dont want you SSL certificates to be getting updated while your backups are running. You server wont die, but why cross the streams :) when you dont have too.
Silence is Golden (optional)
I prefer to make all of the cronjobs quite, they will email me if there is an issue but generally you dont need an email saying they have been run. To fix this you add > /dev/null at the end which sends the output to a null device where it dies.
/usr/local/cwp/php71/bin/php -d max_execution_time=18000 -q /usr/local/cwpsrv/htdocs/resources/admin/include/cron_autossl_all_domains.php to /usr/local/cwp/php71/bin/php -d max_execution_time=18000 -q /usr/local/cwpsrv/htdocs/resources/admin/include/cron_autossl_all_domains.php > /dev/null
Do this for all of the cron jobs yopu want to be quiet. This will not them stop them sending emails if that is what the script does, just the notfication of them running.
Editing Default Cronjobs (in the GUI)
After setting up the server these should be the only cronjobs present. You will find that sometimes after an upgrade or installing a plugin you will get more cronjobs, sometimes duplicates and in which case you should remove the appropriate one.
Notes
CWP does not have a specific mechanisim for backing up the server settings so I will add what I find here and wil post a feature request with CWP.
Please note this section is not complete.
This is an additional step I do and is one of the reasons I like windows.
Notes
Create another VM with the exact same settings except different name, different credentials, different NAT IP and use a Dynamic Disk as you dont need performance. You can then use this for testing and playing with settings that you dont understand (like me) without harming you main server.
sh /scripts/mysql_pwd_reset
passwd <username>
- In testing, Snapshots are your friend and prevent hours of work trying to fix something you broke. On a test server I would always use these to test changes but I am not sure if they are safe on a Production/Live server.
- Dynamic disks will continue to grow over time but can easily have the space recovered by running a VirtualBox command.
- Changing passwords so they dont match the old server is to prevent you from accidentally logging in to the wrong account on the wrong server.
- You might want to turn off all the admin emails off if you are leaving the test VM on for a while
The initial configuration is completeand I wish you well. As I learn more I will update this article. Keep reading to the bottom as you might find answer to common issues.
These instructions have taken me a long time to put together and I am not a Linux professional so pleases bear that in mind when reading this. If you notice any issues or mistakes please let me know and at some point I will tidy it up.
These settings, configurations and notes have not made it into the main tutorial but are worth a read.
When setting up an email account in an app uses these settings (Based/Tested in Outlook 2019)
You should always use a secure port for your SMTP. Each port has different options it will accept
/usr/local/apache/domlogs/DOMAIN.COM.error.log
Notes
I want all of my local devices to be registered on the same local domain (mydomain.com) as my CWP server (server.mydomain.com) so I can ping and connect to devices on my network using FQDN (eg: device.mydomain.com). This can make my network administration a lot easier and I can pretend that my network is a full domain of computers on the internet. This is not the same as Microsoft Active Directory / Windows Domain but will do for me.
My Choice
Because I am running a webserver which controls DNS zones it is best to leave it doing that role. This setup will prevent duplicate entries in the mydomain.com DNS zone and the OpenWRT hosts file.
- Change the Local domain to mydomain.com
- Leave Local server as /lan/ which allows OpenWRT to poll my mydomain.com DNS zone.
- I will add my public facing servers and devices into the mydomain.com DNS zone so they can be access via a FQDN both remotely and locally.
- For devices I need to access via a FQDN locally(private) I will use the Hostnames feature in OpenWRT.
I am running OpenWRT on my router and it currently adds the configured DNS suffix (.lan) on to the end of each registered device's hostname (device.lan). Device hostnames are automatically registered with DHCP in the Active DHCP Leases and can be manually added via Static Leases. Both these lists combine to make single list of FQDN that the router uses for routing traffic.
The instructions below will change the registered hostnames to belong to .mydomain.com giving the format device.mydomain.com when registered instead of device.lan
Notes
OpenWRT has no information or interaction with devices that have static IP addresses because it simple does not know about them.
To remedy this there are 2 ways of doing this:
Hostnames (preferred)
config domain option name 'device' option ip '192.168.1.99'or
config domain option name 'device.mydomain.com' option ip '192.168.1.99'
Static Leases
Static Leases are the ability to use the DHCP system to give the same IP address to the same machine which effectively makes them statics with less configuration at the clients end and more control by the admin, however it does requires some setup work.
Some of you will be saying how does OpenWRT know which device to assign the IP too because I have not set it, well it doesn't. What I have here is just created a host entry that will allow the correct routing but the IP will never be dished out over DHCP. This is more of a hack I discovered. You can use the Static Lease as it was intended by just adding in the following further information (assuming IPv4 only) into the entry.
This option tells OpenWRT that hostnames belonging to this domain (.lan) are never forwarded and are resolved from DHCP or hosts files only. So this means unless your device is on DHCP, has a Static Lease configured or an entry in OpenWRT Hostnames then no traffic will be routed to it because OpenWRT will not do any external DNS requests and when I say external I mean outside of the router itself, it will purley use these 3 sources for lookups.
The purpose of this option is to prevent unnecessary traffic going upstream and reduce the load on your infrastructure.
These instructions will change the Local server from .lan to .mydomain.com
Notes
Do not do this on laptops etc.. if you are going to move above between sites.
As mention above OpenWRT will add DNS suffixes on to the DNS Hostnames to give a FQDN but will not change the computers actual name.
What we are going to do here is a add a Primary Domain Suffix to our Windows PC but this is also not changing the PCs name. Windows has a normal computer name (NetBIOS) that we can add a domain suffix onto it. If you want to change the computer name on your Windows PC it is just as normal (not discussed here)
I cannot think of a reason why I would want to do this on a Windows PC except so SSL/TLS certificates could be issued and then when you use Remote Desktop the computer names match. However for reference I am going to add the instructions here just incase I change my mind.
Change Linux computer name (optional)
Do not do this on laptops etc.. if you are going to move above between sites.
I am not an expert on linux but you when you sent the computers name you can either set device or device.mydomain.com and I assume that it will only send the host name in a DHCP request as Windows does above. So you again have the option to set just a hostname or a full FQDN.
One of the major benefits of this is that I can use the same FQDN to connect to my devices on my local network as I can when I am in the office at work. Great for CCTV and media servers.
Do NOT add non-public devices to DNS zone for security. Only use Static Leases.
You need to do the following for this to work:
Dec 25 11:10:05 cwpserver systemd: Unit httpd.service cannot be reloaded because it is inactive. Dec 25 11:12:20 cwpserver systemd: Unit httpd.service cannot be reloaded because it is inactive. Dec 25 11:13:23 cwpserver systemd: Starting Web server Apache... Dec 25 11:13:23 cwpserver apachectl: (20014)Internal error (specific information not available): AH00058: Error retrieving pid file logs/httpd.pid Dec 25 11:13:23 cwpserver apachectl: AH00059: Remove it before continuing if it is corrupted. Dec 25 11:13:23 cwpserver systemd: httpd.service: control process exited, code=exited status=1 Dec 25 11:13:23 cwpserver systemd: Failed to start Web server Apache. Dec 25 11:13:23 cwpserver systemd: Unit httpd.service entered failed state. Dec 25 11:13:23 cwpserver systemd: httpd.service failed.
Links
Questions
Feature Requests - CWP Suggestions (Forum)
IP:2030/admin/index.php?module=disk_details
Bugs - CWP Bug Tracking / CentOS-WebPanel Bugs (Forum, old?)
; Generated by CWP ; Zone file for test.acc $TTL 14400 @ 86400 IN SOA ns1.mydomain.com. postmaster.test.acc. ( 2021070154 ; serial, todays date+todays 3600 ; refresh, seconds 7200 ; retry, seconds 1209600 ; expire, seconds 86400 ) ; minimum, seconds @ 86400 IN NS ns1.mydomain.com. @ 86400 IN NS ns2.mydomain.com. @ IN A 13.13.13.13 localhost.test.acc. IN A 127.0.0.1 @ IN MX 0 test.acc. mail 14400 IN CNAME test.acc. smtp 14400 IN CNAME test.acc. pop 14400 IN CNAME test.acc. pop3 14400 IN CNAME test.acc. imap 14400 IN CNAME test.acc. webmail 14400 IN A 13.13.13.13 cpanel 14400 IN A 13.13.13.13 cwp 14400 IN A 13.13.13.13 www 14400 IN CNAME test.acc. ftp 14400 IN CNAME test.acc. _dmarc 14400 IN TXT "v=DMARC1; p=none" @ 14400 IN TXT "v=spf1 +a +mx +ip4:13.13.13.13 -all" default._domainkey 14400 IN TXT "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCviXG9SqprOjF3qvN+Xo2KpXp54Fgx6CX42wLxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
; Generated by CWP ; Zone file for test.acc $TTL 14400 test.acc. 86400 IN SOA ns1.mydomain.com. noreply.quantumwarp.com. ( 2013071600 ; serial, todays date+todays 86400 ; refresh, seconds 7200 ; retry, seconds 3600000 ; expire, seconds 86400 ) ; minimum, seconds test.acc. 86400 IN NS ns1.mydomain.com. test.acc. 86400 IN NS ns2.mydomain.com. test.acc. IN A 13.13.13.13 localhost.test.acc. IN A 127.0.0.1 test.acc. IN MX 0 test.acc. mail IN CNAME test.acc. www IN CNAME test.acc. ftp IN CNAME test.acc. ; Add additional settings below this line _dmarc 14400 IN TXT "v=DMARC1; p=none"