#StackBounty: #networking #server #apache2 Enabled http2 but still serving over http1.1

Bounty: 50

To enabled HTTP/2 on my 16.04 server, I followed this guide as recommended by Google, but for some reason my site is still being served over HTTP/1.1. I’ve checked and double checked that everything is correct, restarted the service (and the server!) several times, all to no avail.

  • http2 mod is enabled in apache2.
  • Protocols h2 h2c http/1.1 is added to my site configuration file (and just tested in my apache.conf)
  • I have restarted the service and the server

Am I missing something?

EDIT:

Just ran curl -I -k --http2 https://framework.jacob.rocks/ and received the following…

HTTP/1.1 200 OK
Date: Thu, 20 Jul 2017 17:12:52 GMT
Server: Apache/2.4.27 (Ubuntu)
Upgrade: h2,h2c
Connection: Upgrade
Link: <https://framework.jacob.rocks/wp-json/>; rel="https://api.w.org/"
Link: <https://framework.jacob.rocks/>; rel=shortlink
X-TEC-API-VERSION: v1
X-TEC-API-ROOT: https://framework.jacob.rocks/wp-json/tribe/events/v1/
X-TEC-API-ORIGIN: https://framework.jacob.rocks
Content-Type: text/html; charset=UTF-8


Get this bounty!!!

#StackBounty: #server #permissions #ssh #shared-folders #sftp Set up upload permissions for a share folder on server via ssh

Bounty: 50

I have set up a headless home file server using Ubuntu Server 17.04. I access it over WiFi using SSH from my laptop running standard Ubuntu 17.04. I have found that SSH (SFTP) is sufficient for my needs for serving files (e.g. music and photographs) for my home network.

Now I would like to be able to upload files to a folder on my server’s hard drive /dev/sda1, which is currently mounted as /media/a. It uses the ext4 Linux filesystem and I mounted it using the command sudo mount /dev/sda1 /media/a.

I can run SSH commands from the terminal (by logging in with ssh username@servername) and I can access the files via the GUI on my laptop (files > other locations > connect to server > sftp://username@servername). However when I try to create a new folder (say) it says

Error creating new folder: permission denied.

I tried setting the permissions on an upload folder (newly created via my ssh session) with sudo chmod o=rwx /media/a/upload. However, when I now try to create a folder there via the GUI on my laptop, it says

Error creating new folder: unknown reason.

How can I upload files to my server from my laptop?

Edit: Here is the contents of my /etc/ssh/sshd_config file, as requested:

#   $OpenBSD: sshd_config,v 1.100 2016/08/15 12:32:04 naddy Exp $

# This is the sshd server system-wide configuration file.  See
# sshd_config(5) for more information.

# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin

# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented.  Uncommented options override the
# default value.

#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::

#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_ecdsa_key
#HostKey /etc/ssh/ssh_host_ed25519_key

# Ciphers and keying
#RekeyLimit default none

# Logging
#SyslogFacility AUTH
#LogLevel INFO

# Authentication:

#LoginGraceTime 2m
#PermitRootLogin prohibit-password
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10

#PubkeyAuthentication yes

# Expect .ssh/authorized_keys2 to be disregarded by default in future.
#AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys2

#AuthorizedPrincipalsFile none

#AuthorizedKeysCommand none
#AuthorizedKeysCommandUser nobody

# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes

# To disable tunneled clear text passwords, change to no here!
#PasswordAuthentication yes
#PermitEmptyPasswords no

# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no

# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes
#GSSAPIStrictAcceptorCheck yes
#GSSAPIKeyExchange no

# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication.  Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM yes

#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PermitTTY yes
PrintMotd no
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#UsePrivilegeSeparation sandbox
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS no
#PidFile /var/run/sshd.pid
#MaxStartups 10:30:100
#PermitTunnel no
#ChrootDirectory none
#VersionAddendum none

# no default banner path
#Banner none

# Allow client to pass locale environment variables
AcceptEnv LANG LC_*

# override default of no subsystems
Subsystem   sftp    /usr/lib/openssh/sftp-server

# Example of overriding settings on a per-user basis
#Match User anoncvs
#   X11Forwarding no
#   AllowTcpForwarding no
#   PermitTTY no
#   ForceCommand cvs server


Get this bounty!!!

#StackBounty: #server #gnome #system-installation gnome sessions on tty1 and tty2

Bounty: 100

I had some issues with the installation of the desktop version of Ubuntu gnome (my graphic-card is not supported by default I had to install the right drive for it, before I get a shell thats not totally broken, even with the server install I had to input the driver installation command blind), so I decided to install Ubuntu server and then install ubuntu-gnome-desktop

Thats the state know. Everything is “fine”, but there a two things I don’t understand:

  1. after installing the desktop I had to run startx to get the visual desktop, after a reboot I got the login-screen by default.

  2. When I switch the tty with SUPER+ALT [F1,F2,…] there is my gnome-desktop running on tty2 and a login screen on tty1. When I try to log in on tty1 I end up on tty2 and on tty1 appease the login-screen again.


Get this bounty!!!

#StackBounty: #server #kernel #maas Should I add HWE kernel to the Ubuntu server manual installation (not from a hosting provider)?

Bounty: 50

Manually installing Ubuntu server (not from a hosting provider) – Should I add a HWE kernel?

The moment I mount the ISO in my VirtualBox and starting the installation process, I am being asked for 4 options. 1 For a regular Ubuntu server, another one for an Ubuntu server that includes HWE and the last 2 for MASS including server.

It is clear to me MAAS is not something I need but I do understand that inclusion of the HEW kernel inside Ubuntu might result in better hardware utilization (I don’t know to say exactly way) and I was thinking that if tomorrow I change my PC to a new one there might be software discrepancies which HWE avoid.

Am I right? Should I choose HWE to ensure better software compatibility?


Get this bounty!!!

#StackBounty: #networking #16.04 #server #hostapd Is there a way to debug wireless access point issues that was setup with hostapd?

Bounty: 50

I am trying to setup a wireless access point with a home PC. I replaced my old Intel wifi link 5100 with Atheros AR9462. I recently did a fresh Ubuntu Server 16.04 install.

To setup wireless access point I installed hostapd and created a simple configuration

# cat /etc/hostapd/hostapd.conf 
interface=wlp3s0
driver=nl80211
ssid=mytestnetwork
channel=1
auth_algs=1
ignore_broadcast_ssid=0
wpa=0

And here is how my network interfaces are configured:

# cat /etc/network/interfaces
source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback

auto enp1s0
iface enp1s0 inet dhcp

auto wlp3s0
iface wlp3s0 inet static
address 10.10.0.1
netmask 255.255.255.0

After these configurations, I rebooted the device. My network is active (checked via /etc/init.d/networking status). hostapd (checked via service hostapd status) seems to be running fine. However, I cannot event detect the wireless access point from any other device.

My wireless card is functioning in master mode:

# iwconfig
wlp3s0    IEEE 802.11abgn  Mode:Master  Tx-Power=19 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:off

lo        no wireless extensions.

enp1s0    no wireless extensions.

My network hardware results look like the following:

# lshw -C network
  *-network               
       description: Ethernet interface
       product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:01:00.0
       logical name: enp1s0
       version: 07
       serial: 00:e0:4c:68:18:fd
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full firmware=rtl8168e-3_0.0.4 03/27/12 ip=192.168.1.6 latency=0 link=yes multicast=yes port=MII speed=1Gbit/s
       resources: irq:120 ioport:e000(size=256) memory:a0004000-a0004fff memory:a0000000-a0003fff
  *-network
       description: Wireless interface
       product: AR9462 Wireless Network Adapter
       vendor: Qualcomm Atheros
       physical id: 0
       bus info: pci@0000:03:00.0
       logical name: wlp3s0
       version: 01
       serial: 44:c3:06:31:a7:b0
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list rom ethernet physical wireless
       configuration: broadcast=yes driver=ath9k driverversion=4.4.0-62-generic firmware=N/A ip=10.10.0.1 latency=0 link=yes multicast=yes wireless=IEEE 802.11abgn
       resources: irq:18 memory:81200000-8127ffff memory:81280000-8128ffff

How can I troubleshoot this issue further and find out what is going wrong?


Get this bounty!!!

#StackBounty: #server #virtualbox #headless Accessing headless virtual box web server installed on a parent server

Bounty: 50

I have installed a headless Virtual Box on my server A, this virtual box contains another ubuntu server B. I can ssh from my laptop to server A, and from server A to server B, but how can I ssh directly from my laptop to server B ?

My goal is to access the web server which is on server B from my laptop.

Below are my current network settings.

  • ifconfig on server A
    ifconfig on server A

  • Headless VirtualBox settings (VB is on server A)
    VirtualBox : preferences
    VirtualBox : server B settings : Adaptater 1
    VirtualBox : server B settings : Adaptater 2

  • ifconfig on server B
    ifconfig on server B


Get this bounty!!!

Apache Commons DbUtils Mini Wrapper

This is a very small DB Connector code in Java as a wrapper class to Apache DBUtils.

The Commons DbUtils library is a small set of classes designed to make working with JDBC easier. JDBC resource cleanup code is mundane, error prone work so these classes abstract out all of the cleanup tasks from your code leaving you with what you really wanted to do with JDBC in the first place: query and update data.

Some of the advantages of using DbUtils are:

  • No possibility for resource leaks. Correct JDBC coding isn’t difficult but it is time-consuming and tedious. This often leads to connection leaks that may be difficult to track down.
  • Cleaner, clearer persistence code. The amount of code needed to persist data in a database is drastically reduced. The remaining code clearly expresses your intention without being cluttered with resource cleanup.
  • Automatically populate Java Bean properties from Result Sets. You don’t need to manually copy column values into bean instances by calling setter methods. Each row of the Result Set can be represented by one fully populated bean instance.

DbUtils is designed to be:

  • Small – you should be able to understand the whole package in a short amount of time.
  • Transparent – DbUtils doesn’t do any magic behind the scenes. You give it a query, it executes it and cleans up for you.
  • Fast – You don’t need to create a million temporary objects to work with DbUtils.

DbUtils is not:

  • An Object/Relational bridge – there are plenty of good O/R tools already. DbUtils is for developers looking to use JDBC without all the mundane pieces.
  • A Data Access Object (DAO) framework – DbUtils can be used to build a DAO framework though.
  • An object oriented abstraction of general database objects like a Table, Column, or Primary Key.
  • A heavyweight framework of any kind – the goal here is to be a straightforward and easy to use JDBC helper library.

Wrapper:

Apache Solr vs Elasticsearch: The Feature Smackdown

API

Feature Solr 5.3.0 ElasticSearch 2.0
Format XML,CSV,JSON JSON
HTTP REST API
Binary API SolrJ TransportClient, Thrift (through a plugin)
JMX support ES specific stats are exposed through the REST API
Official client libraries Java Java, Groovy, PHP, Ruby, Perl, Python, .NET, JavascriptOfficial list of clients
Community client libraries PHP, Ruby, Perl, Scala, Python, .NET, Javascript, Go, Erlang, Clojure Clojure, Cold Fusion, Erlang, Go, Groovy, Haskell, Java, JavaScript, .NET, OCaml, Perl, PHP, Python, R, Ruby, Scala, Smalltalk, Vert.x Complete list
3rd-party product integration (open-source) Drupal, Magento, Django, ColdFusion, WordPress, OpenCMS, Plone, Typo3, ez Publish, Symfony2, Riak (via Yokozuna) Drupal, Django, Symfony2, WordPress, CouchBase
3rd-party product integration (commercial) DataStax Enterprise Search, Cloudera Search, Hortonworks Data Platform, MapR SearchBlox, Hortonworks Data Platform, MapR etcComplete list
Output JSON, XML, PHP, Python, Ruby, CSV, Velocity, XSLT, native Java JSON, XML/HTML (via plugin)

Infrastructure

Feature Solr 5.3.0 ElasticSearch 2.0
Master-slave replication Only in non-SolrCloud. In SolrCloud, behaves identically to ES. Not an issue because shards are replicated across nodes.
Integrated snapshot and restore Filesystem Filesystem, AWS Cloud Plugin for S3 repositories, HDFS Plugin for Hadoop environments, Azure Cloud Plugin for Azure storage repositories

Indexing

Feature Solr 5.3.0 ElasticSearch 2.0
Data Import DataImportHandler – JDBC, CSV, XML, Tika, URL, Flat File [DEPRECATED in 2.x] Rivers modules – ActiveMQ, Amazon SQS, CouchDB, Dropbox, DynamoDB, FileSystem, Git, GitHub, Hazelcast, JDBC, JMS, Kafka, LDAP, MongoDB, neo4j, OAI, RabbitMQ, Redis, RSS, Sofa, Solr, St9, Subversion, Twitter, Wikipedia
ID field for updates and deduplication
DocValues
Partial Doc Updates with stored fields with _source field
Custom Analyzers and Tokenizers
Per-field analyzer chain
Per-doc/query analyzer chain
Synonyms Supports Solr and Wordnet synonym format
Multiple indexes
Near-Realtime Search/Indexing
Complex documents
Schemaless 4.4+
Multiple document types per schema One set of fields per schema, one schema per core
Online schema changes Schemaless mode or via dynamic fields. Only backward-compatible changes.
Apache Tika integration
Dynamic fields
Field copying via multi-fields
Hash-based deduplication Murmur plugin or ER plugin

Searching

Feature Solr 5.3.0 ElasticSearch 2.0
Lucene Query parsing
Structured Query DSL Need to programmatically create queries if going beyond Lucene query syntax.
Span queries via SOLR-2703
Spatial/geo search
Multi-point spatial search
Faceting Top N term accuracy can be controlled with shard_size
Advanced Faceting New JSON faceting API blog post
Geo-distance Faceting
Pivot Facets
More Like This
Boosting by functions
Boosting using scripting languages
Push Queries JIRA issue Percolation. Distributed percolation supported in 1.0
Field collapsing/Results grouping
Spellcheck Suggest API
Autocomplete
Query elevation workaround
Joins Joined index has to be single-shard and replicated across all nodes. via has_children and top_children queries
Resultset Scrolling New to 4.7.0 via scan search type
Filter queries also supports filtering by native scripts
Filter execution order local params and cache property
Alternative QueryParsers DisMax, eDisMax query_string, dis_max, match, multi_match etc
Negative boosting but awkward. Involves positively boosting the inverse set of negatively-boosted documents.
Search across multiple indexes it can search across multiple compatible collections
Result highlighting
Custom Similarity
Searcher warming on index reload Warmers API
Term Vectors API

Customizability

Feature Solr 5.3.0 ElasticSearch 2.0
Pluggable API endpoints
Pluggable search workflow via SearchComponents
Pluggable update workflow
Pluggable Analyzers/Tokenizers
Pluggable Field Types
Pluggable Function queries
Pluggable scoring scripts
Pluggable hashing
Pluggable webapps site plugin
Automated plugin installation Installable from GitHub, maven, sonatype or elasticsearch.org

 

Full article

How to install Weblogic Server 10.3.6

Follow the link: Weblogic Server 10.3.6

  • Accept the user agreement radio button. The link to download(Oracle WebLogic Server 11gR1 (10.3.6) ZIP Distribution) will be enabled.
    Note: You will be asked to login for the same.
  • click on the download link and the server jar file will be downloaded(wls1036_generic.jar)
  • Follow the complete steps mentioned here, or follow below steps:
    • Open CMD
    • Navigate to the directory where the file has been downloaded.
    • Run the following command as Admin

      java -jar wls1036_generic.jar

    • On Welcome, click the Next button.
    • On Choose Middleware Home Directory. select option

      Create a new Middleware Home

      create_middle_home_dir_win
      click the Next button

    • On Register for Security Updates, enter email id, and unselect the security updates checkbox. This will disable update information.
      reg_updates_win
      Click the Next button
    • Select Typical install on Choose Install Type Screen and keep clicking next for default options as shown:
      choose_shortcut_location
      install_type_1036
      choose_products
      jdk_select_win
      choose_install_dirs_win
      install_summary_wininstall_complete_1036
      Click on Done.
    • Domain Configuration(Quick Start) will open:
      quickstart_1036
    • On the QuickStart links panel, select this link

      Getting started with WebLogic Server 10.3.6

    • Follow the wizard as shown below:
      select_domain_source
      Enter domain related details
      specify_domain_name
      image020
      config_server_start_mode
      image022
      config_summary_win
      creating_domain_prog
  • Your weblogic server is now installed.

How to make a dropdown as readonly in html

I encountered a problem where in it was required to make a drop down readonly.

While searching over internet i found THIS
But the solution mentioned there, didn’t appeal me much. As i had to make server side code changes while saving the value using the hidden field.

How do we do this? The common thought is to disable the drop down menu. Well, yes, but there’s a choice

When you use disabled, it prevents the user from using the drop down, or form element. You can see the year, but it is grayed out. Your mouse can’t select or change it, and you can’t tab to it with the keyboard. Disabled is used a lot with checkboxes. Sounds like just what we want, but you unknowingly might have caused yourself a small development problem.

The problem is “disabled” does just that. Disabled means that in your $_POST or $_GET that element will not show up in your controller. If you want to use the year in your controller, you won’t be able to recover it from that form. All you can do it look at the value on the web page.

What if we want to read the year, prevent the user from changing the year, and recover the year in the form data sent back to the controller. The solution for this is

Make a replica of your dropdown with a different name and different id.

Hide your original drop down with
This makes the element available in the form, so it will flow to the server side as well.
At the same time, it will give a look and feel of disabled to the user.

Example :